diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2013-07-31 15:49:08 -0700 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2013-07-31 15:49:08 -0700 |
commit | a6f568acc60a44c3b01f133517ff61b3b520142b (patch) | |
tree | f1b962088507635e68a17a5076df33819067a4e3 /activesupport/lib/active_support/core_ext/date_time/zones.rb | |
parent | 5e9f49aad94d11c19626c95189223aa88896ae22 (diff) | |
parent | 3102a9aa4cfd747e116adc12dce6f5faf1453ea9 (diff) | |
download | rails-a6f568acc60a44c3b01f133517ff61b3b520142b.tar.gz rails-a6f568acc60a44c3b01f133517ff61b3b520142b.tar.bz2 rails-a6f568acc60a44c3b01f133517ff61b3b520142b.zip |
Merge pull request #11686 from gzohari/pr-refactor-time-datetime
Refactor Date, Time, DateTime timezone methods
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date_time/zones.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date_time/zones.rb | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/activesupport/lib/active_support/core_ext/date_time/zones.rb b/activesupport/lib/active_support/core_ext/date_time/zones.rb index 01a627f8af..c39f358395 100644 --- a/activesupport/lib/active_support/core_ext/date_time/zones.rb +++ b/activesupport/lib/active_support/core_ext/date_time/zones.rb @@ -1,25 +1,6 @@ require 'date' -require 'active_support/core_ext/time/zones' +require 'active_support/core_ext/date_and_time/zones' class DateTime - # Returns the simultaneous time in <tt>Time.zone</tt>. - # - # Time.zone = 'Hawaii' # => 'Hawaii' - # DateTime.new(2000).in_time_zone # => Fri, 31 Dec 1999 14:00:00 HST -10:00 - # - # This method is similar to Time#localtime, except that it uses <tt>Time.zone</tt> - # as the local zone instead of the operating system's time zone. - # - # You can also pass in a TimeZone instance or string that identifies a TimeZone - # as an argument, and the conversion will be based on that zone instead of - # <tt>Time.zone</tt>. - # - # DateTime.new(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00 - def in_time_zone(zone = ::Time.zone) - if zone - ActiveSupport::TimeWithZone.new(utc? ? self : getutc, ::Time.find_zone!(zone)) - else - self - end - end + include DateAndTime::Zones end |