Project

General

Profile

Bug #10698

Time#local behaves differently during clock change

Added by boris (Boris Ruf) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
[ruby-core:67345]

Description

This is probably not a bug but since it changes previous behavior it should be noted somewhere.

Ruby 2.1.5:

>> ENV['TZ'] = 'Europe/Berlin'
=> "Europe/Berlin"
>> Time.local(2011,10,30,2,0,0).zone
=> "CET"

Ruby 2.2.0:

>> ENV['TZ'] = 'Europe/Berlin'
=> "Europe/Berlin"
>> Time.local(2011,10,30,2,0,0).zone
=> "CEST"

So in older Ruby versions the object represents the time after the clock change (within the extra hour), while in Ruby 2.2.0 it represents the time before time is set back.

Updated by akr (Akira Tanaka) over 5 years ago

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

Applied in changeset r49162.


  • time.c (timelocalw): Set tm_isdst field -1 if vtm->isdst is VTM_ISDST_INITVAL. This bug is introduced at packing struct vtm (r45155). [ruby-core:67345] [Bug #10698] Reported by Boris Ruf.

Updated by nagachika (Tomoyuki Chikanaga) over 5 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED

Updated by naruse (Yui NARUSE) over 5 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE

ruby_2_2 r49284 merged revision(s) 49162.

Also available in: Atom PDF