From dbc7a7cb509ef0046afa327d4ac8330259fd8e73 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sat, 23 Apr 2016 18:01:38 +0100 Subject: Add additional aliases for DateTime#utc --- activesupport/CHANGELOG.md | 5 +++++ activesupport/lib/active_support/core_ext/date_time/calculations.rb | 2 ++ 2 files changed, 7 insertions(+) (limited to 'activesupport') 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 Time.local() instance of the simultaneous time in your # system's ENV['TZ'] zone. -- cgit v1.2.3