Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime CPAN distribution.

Report information
The Basics
Id: 71274
Status: resolved
Priority: 0/
Queue: DateTime

People
Owner: Nobody in particular
Requestors: zefram [...] fysh.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: minutes offset broken at leap second
Date: Tue, 27 Sep 2011 13:11:42 +0100
To: bug-DateTime [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
$ perl -MDateTime -lwe '$dt=DateTime->new(year=>2008,month=>12,day=>31,hour=>23,minute=>59,second=>60, time_zone=>"UTC"); $dt->set_time_zone("+00:05:00"); print $dt' 2009-01-01T23:59:60 $ perl -MDateTime -lwe '$dt=DateTime->new(year=>2008,month=>12,day=>31,hour=>23,minute=>59,second=>60, time_zone=>"UTC"); $dt->set_time_zone("-00:05:00"); print $dt' 2008-12-31T22:59:60 Only happens for a time in a leap second. With a +ve offset, the minutes part of the offset is completely ignored. With a -ve offset, any non-zero number of minutes in the offset has the effect of a 1 *hour* (negative) offset. Hours added onto this behave correctly. Timezone offsets that are integral multiples of minutes have perfectly well defined behaviour around leap seconds, when you're looking at broken-down hh:mm:ss time-of-day. -zefram
Ticket migrated to GitHub as https://github.com/houseabsolute/t/issues/2
Oops, not migrated quite yet.