Project

General

Profile

Backport #3268

Time.parse is not restoring the timezone properly on Windows

Added by luislavena (Luis Lavena) about 9 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:30139]

Description

=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

History

#1

Updated by luislavena (Luis Lavena) about 9 years ago

=begin
Bumping this.

Any 1.9.1 maintainer that can look at this?

Seems to me a missed backport.
=end

Updated by luislavena (Luis Lavena) about 7 years ago

  • Tracker changed from Bug to Backport
  • Description updated (diff)
  • Status changed from Open to Closed

A year went by, 1.9.1 is dead by now.

Also available in: Atom PDF