1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

rake time:zones:local finds correct base utc offset for zones in the Southern Hemisphere

This commit is contained in:
Geoffrey Buesing 2008-04-12 16:06:29 -05:00
parent 60be4b09f5
commit cfd56882af
2 changed files with 6 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* rake time:zones:local finds correct base utc offset for zones in the Southern Hemisphere [Geoff Buesing]
* Don't require rails/gem_builder during rails initialization, it's only needed for the gems:build task. [rick]
* script/performance/profiler compatibility with the ruby-prof >= 0.5.0. Closes #9176. [Catfish]

View file

@ -24,7 +24,10 @@ namespace :time do
desc 'Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time'
task :local do
build_time_zone_list(:all, Time.now.beginning_of_year.utc_offset)
jan_offset = Time.now.beginning_of_year.utc_offset
jul_offset = Time.now.beginning_of_year.change(:month => 7).utc_offset
offset = jan_offset < jul_offset ? jan_offset : jul_offset
build_time_zone_list(:all, offset)
end
# to find UTC -06:00 zones, OFFSET can be set to either -6, -6:00 or 21600