Re: epoch to UTCstring conversion at leap-second boundary

2012-04-06 Thread Dave Rolsky

On Thu, 5 Apr 2012, Karen Etheridge wrote:


On Thu, Apr 05, 2012 at 01:32:24PM -0700, Andrew Davis wrote:

The 'hour' parameter (24) to DateTime::new did not pass the 'an
integer between 0 and 23' callback

I'm hoping someone can tell me the best way to avoid the error, and
get the 2008-12-31T23:59:60 output that I want.


This sounds like a bug in DateTime core - just as it isn't always invalid
for months (for February, in leap years) to be [0,28], it is not always
invalid for 'seconds' to be [0,59] or hours [0,23] (for leap seconds).


Say what? The hour is always 0-23, regardless of leap seconds or DST.


-dave

/*
http://VegGuide.org   http://blog.urth.org
Your guide to all that's veg  House Absolute(ly Pointless)
*/


Re: epoch to UTCstring conversion at leap-second boundary

2012-04-06 Thread Andrew Davis

Hi Dave,
I do agree, the hour should never be allowed to become 24.

Looking at the error output, it seems clear that the DateTime module,
or the Format::Epoch piece, is internally attempting to create a DateTime
object using hour=24, minute=0, and second=0. That's an error for sure.

What it should be doing (I believe, given the epoch that I fed to it)
is set hour=23, minute=59, second=60.

I don't think my perl script is the culprit.
The script is feeding the module a perfectly valid epoch.

Cheers,
Andrew

At 09:04 PM 2012-04-06, Dave Rolsky wrote:

On Thu, 5 Apr 2012, Karen Etheridge wrote:


On Thu, Apr 05, 2012 at 01:32:24PM -0700, Andrew Davis wrote:

The 'hour' parameter (24) to DateTime::new did not pass the 'an
integer between 0 and 23' callback

I'm hoping someone can tell me the best way to avoid the error, and
get the 2008-12-31T23:59:60 output that I want.


This sounds like a bug in DateTime core - just as it isn't always invalid
for months (for February, in leap years) to be [0,28], it is not always
invalid for 'seconds' to be [0,59] or hours [0,23] (for leap seconds).


Say what? The hour is always 0-23, regardless of leap seconds or DST.


-dave

/*
http://VegGuide.org   http://blog.urth.org
Your guide to all that's veg  House Absolute(ly Pointless)
*/