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: 71272
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: silly seconds value at leap second
Date: Tue, 27 Sep 2011 13:05:30 +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:00:59"); print $dt' 2009-01-01T23:59:119 Only happens for a time located within a leap second, when combined with a timezone offset that is not an integral number of minutes. That's an inherently problematic combination, but giving a reading of 119 seconds into the minute is not an acceptable response. You could fudge it to give the same (sane) response as the preceding or following second, 00:00:58 or 00:00:59, or you could throw an exception. -zefram
Ticket migrated to GitHub as https://github.com/houseabsolute/t/issues/1
Oops, not migrated quite yet.