From: Luis Lavena Date: 2010-05-11T07:24:21+09:00 Subject: [ruby-core:30139] [Bug #3268] Time.parse is not restoring the timezone properly on Windows Bug #3268: Time.parse is not restoring the timezone properly on Windows http://redmine.ruby-lang.org/issues/show/3268 Author: Luis Lavena Status: Open, Priority: Normal ruby -v: ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] Hello, This issue has been reported by Jeremy Evans to RubyInstaller project: http://groups.google.com/group/rubyinstaller/browse_thread/thread/1d49ca41486bba89 This simple code exposes the issue: ruby -v -rtime -e "puts Time.now.dst?; t = Time.now.to_s; puts t; puts Time.parse(t); puts Time.parse(t).dst?" The following is the output of all the installed Ruby versions I have:

pik tags mingw ruby -rtime -e "puts Time.now.dst?; t = Time.now.to_s; puts t; puts Time.parse(t); puts Time.parse(t).dst?"
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]

true
Mon May 10 18:21:00 -0400 2010
Mon May 10 18:21:00 -0400 2010
true

ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]

true
Mon May 10 18:21:00 -0400 2010
Mon May 10 18:21:00 -0400 2010
true

ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]

true
2010-05-10 18:21:00 -0500
2010-05-10 19:21:00 -0500
true

ruby 1.9.2dev (2010-04-23 trunk 27453) [i386-mingw32]

true
2010-05-10 18:21:01 -0400
2010-05-10 18:21:01 -0400
true
As you can see, while parsed string return DST, the time for 1.9.1 is incorrect. All other versions work correctly. Maybe this is a missed backport to 1.9.1 branch? Just tested ruby_1_9_1 branch: ruby -v -rtime -e "puts Time.now.dst?; t = Time.now.to_s; puts t; puts Time.parse(t); puts Time.parse(t).dst?" ruby 1.9.1p424 (2010-05-03 revision 27598) [i386-mingw32] true 2010-05-10 18:23:17 -0500 2010-05-10 19:23:17 -0500 true Same results. Thank you. ---------------------------------------- http://redmine.ruby-lang.org