From: Hirotsugu Asari Date: 2010-06-09T08:52:28+09:00 Subject: [ruby-core:30682] Re: [Bug #3411] Time.local 1916,5,1 #=> 1916-04-30 23:00:00 +0100 On Jun 8, 2010, at 6:42 PM, Benoit Daloze wrote: > Hi ! > On 9 June 2010 00:27, Yukihiro Matsumoto wrote: >> Hi, >> >> Cannot reproduce on my timezone. Could you tell us your timezone >> setting? >> >> matz. > > Yes, I suppose The Land of the Rising Sun is far enough from UTC :) > > I am at Brussels, BRU - Belgium, CEST (UTC+2) (and so CET (UTC+1) in > winter). > > On 9 June 2010 00:34, Hirotsugu Asari wrote: >> I think this is most definitely a time zone thing: >> $ uname -a; TZ=Europe/Amsterdam ruby1.9 -e 'p Time.local 1916,5,1' >> Darwin aotearoa.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 >> 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386 >> 1916-04-30 23:00:00 +0020 >> Besides Europe/Amsterdam, Asia/Istanbul and Europe/Brussels return >> this >> result on my machine. > > Indeed, this seems particular to UTC+1 > Is this expected? : > $ TZ=Europe/Bucharest ruby -e 'p Time.local 1916,5,1' # 1916-05-01 > 00:00:00 +0144 > $ TZ=Europe/Budapest ruby -e 'p Time.local 1916,5,1' # 1916-05-01 > 00:00:00 +0200 > $ TZ=Europe/Riga ruby -e 'p Time.local 1916,5,1' # 1916-05-01 > 00:00:00 +0136 > $ TZ=Europe/Helsinki ruby -e 'p Time.local 1916,5,1' # 1916-05-01 > 00:00:00 +0140 > > Should I try to find some history about timezones? (if I use Time.now, > I get expected results) > > Anyway, knowing timezones have changed, I think I should use only > Time.utc for old dates in which only the day matters. You can read zoneinfo database and see which dates are "funny" in which time zones. > But this is still surprising me. > > Regards, > B.D. >