From: "luislavena (Luis Lavena)" Date: 2012-07-22T09:36:29+09:00 Subject: [ruby-core:46605] [Archive91 - Backport #3268][Closed] Time.parse is not restoring the timezone properly on Windows Issue #3268 has been updated by luislavena (Luis Lavena). Tracker changed from Bug to Backport Description updated Status changed from Open to Closed A year went by, 1.9.1 is dead by now. ---------------------------------------- Backport #3268: Time.parse is not restoring the timezone properly on Windows https://bugs.ruby-lang.org/issues/3268#change-28269 Author: luislavena (Luis Lavena) Status: Closed Priority: Normal Assignee: Category: Target version: =begin 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. =end -- http://bugs.ruby-lang.org/