Project

General

Profile

Backport #6135

DateTime.now incorrect offset on Windows after daylight savings time change

Added by jeremyevans0 (Jeremy Evans) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:43256]

Description

C:\>ruby -v -r date -e 'p Time.now; p DateTime.now'
ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
2012-03-12 14:55:05 -0700
#<DateTime: 2012-03-12T14:55:05-08:00 ((2455999j,82505s,413234000n),-28800s,2299161j)>

Note how the DateTime offset is -08:00 (incorrect) while the Time offset is -0700 (correct). This probably started happening yesterday, March 11, since that is the start of daylight savings time in the United States. My guess is that DateTime is somehow using the pre-2007 daylight savings time cutoffs (first Sunday in April instead of second Sunday in March), but that's not an informed guess.

This doesn't happen in ruby 1.9.2, so it's probably related to the new 1.9.3 date C extension (switch_hitter). Operating system is Windows XP SP3.

Associated revisions

Revision d66248a7
Added by naruse (Yui NARUSE) over 7 years ago

merge revision(s) 35002: [Backport #6135]

    * ext/date/date_core.c (datetime_s_now): [ruby-core:43256].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 35177
Added by naruse (Yui NARUSE) over 7 years ago

merge revision(s) 35002: [Backport #6135]

* ext/date/date_core.c (datetime_s_now): [ruby-core:43256].

History

Updated by jeremyevans0 (Jeremy Evans) over 7 years ago

This should be fixed by r35002, so this ticket can be closed. I'll open a backport ticket for 1.9.3.

Edit: Looks like for backports, instead of opening a new ticket, the current ticket is moved. Can someone move this ticket to the Backport93 project?

#2

Updated by nagachika (Tomoyuki Chikanaga) over 7 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
#3

Updated by naruse (Yui NARUSE) over 7 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r35177.
Jeremy, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 35002: [Backport #6135]

* ext/date/date_core.c (datetime_s_now): [ruby-core:43256].

Also available in: Atom PDF