From cfd56882af597724e427b17cdf295ffdd241dc26 Mon Sep 17 00:00:00 2001 From: Geoffrey Buesing Date: Sat, 12 Apr 2008 16:06:29 -0500 Subject: rake time:zones:local finds correct base utc offset for zones in the Southern Hemisphere --- railties/lib/tasks/misc.rake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'railties/lib') diff --git a/railties/lib/tasks/misc.rake b/railties/lib/tasks/misc.rake index d083a8aef4..61042595f9 100644 --- a/railties/lib/tasks/misc.rake +++ b/railties/lib/tasks/misc.rake @@ -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 -- cgit v1.2.3