I’m trying to figure out how Ruby’s Time class deals with timezones and
standard/summer time, and noticed the following inconsistency (second
one down):
t = Time.local(2006, 3, 26, 0, 59, 59) # winter
p [t.isdst, t] # [false, Sun Mar 26 00:59:59 GMT 2006]
t = Time.local(2006, 3, 26, 1, 0, 0) # summer
p [t.isdst, t] # [true, Sun Mar 26 02:00:00 BST 2006] # why not
01:00:00???
t = Time.local(2006, 3, 26, 2, 0, 0) # summer
p [t.isdst, t] # [true, Sun Mar 26 02:00:00 BST 2006]
t = Time.local(2006, 10, 29, 0, 12, 31) # summer
p [t.isdst, t] # [true, Sun Oct 29 00:12:31 BST 2006]
t = Time.local(2006, 10, 29, 1, 12, 31) # summer
p [t.isdst, t] # [true, Sun Oct 29 01:12:31 BST 2006]
t = Time.local(2006, 10, 29, 1, 12, 32) # winter
p [t.isdst, t] # [false, Sun Oct 29 01:12:32 GMT 2006]
t = Time.local(2006, 10, 29, 2, 10, 32) # winter
p [t.isdst, t] # [false, Sun Oct 29 02:10:32 GMT 2006]
Is this a bug? (If not, what’s the explanation for it?)
Thanks