diff options
author | Andrew White <andrew.white@unboxedconsulting.com> | 2016-04-23 18:01:38 +0100 |
---|---|---|
committer | Andrew White <andrew.white@unboxedconsulting.com> | 2016-04-23 18:01:38 +0100 |
commit | dbc7a7cb509ef0046afa327d4ac8330259fd8e73 (patch) | |
tree | 914a2d88ec8e0b9c4eb66005536da544fdc1c6c6 /activesupport | |
parent | 229737e8f367ed0930cd801af459f15d69c18031 (diff) | |
download | rails-dbc7a7cb509ef0046afa327d4ac8330259fd8e73.tar.gz rails-dbc7a7cb509ef0046afa327d4ac8330259fd8e73.tar.bz2 rails-dbc7a7cb509ef0046afa327d4ac8330259fd8e73.zip |
Add additional aliases for DateTime#utc
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/CHANGELOG.md | 5 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/date_time/calculations.rb | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 3c9e1477df..304b540aa2 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,8 @@ +* Add additional aliases for `DateTime#utc` to mirror the ones on + `ActiveSupport::TimeWithZone` and `Time`. + + *Andrew White* + * Add `DateTime#localtime` to return an instance of `Time` in the system's local timezone. Also aliased to `getlocal`. diff --git a/activesupport/lib/active_support/core_ext/date_time/calculations.rb b/activesupport/lib/active_support/core_ext/date_time/calculations.rb index e6eaa02a60..1eaf51243c 100644 --- a/activesupport/lib/active_support/core_ext/date_time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/date_time/calculations.rb @@ -150,7 +150,9 @@ class DateTime def utc new_offset(0) end + alias_method :getgm, :utc alias_method :getutc, :utc + alias_method :gmtime, :utc # Returns a <tt>Time.local()</tt> instance of the simultaneous time in your # system's <tt>ENV['TZ']</tt> zone. |