Leap Seconds and Epochs

2005-11-20 Thread Rick Measham
Why does time() return a multiple of 60? Surely each time there's a leap second time()%60 should increment? Cheers! Rick Measham

Re: Leap Seconds and Epochs

2005-11-20 Thread mathieu longtin
Cause time since the epoch doesn't measure leap seconds. See in the DateTime manual, under the epoch() method description. On 11/20/05, Rick Measham [EMAIL PROTECTED] wrote: Why does time() return a multiple of 60? Surely each time there's a leap second time()%60 should increment? Cheers!

Re: Leap Seconds and Epochs

2005-11-20 Thread Rick Measham
mathieu longtin wrote: Cause time since the epoch doesn't measure leap seconds. See in the DateTime manual, under the epoch() method description. I'm aware that it doesn't measure them ... but I'm wondering why? Surely that makes it Capital-W-Wrong. Perl will return the Wrong number of

A sane answer for datetime subtraction?

2005-11-20 Thread Dave Rolsky
I think I've hit upon a fairly sane answer, although it makes the internals of DateTime.pm even yuckier than before (which may be hard to imagine if you've already poked around in some of the methods ;) I've summarized it on the wiki here: http://datetime.perl.org/wiki/index.cgi?MathProblems

Re: Leap Seconds and Epochs

2005-11-20 Thread Dave Rolsky
On Mon, 21 Nov 2005, Rick Measham wrote: mathieu longtin wrote: Cause time since the epoch doesn't measure leap seconds. See in the DateTime manual, under the epoch() method description. I'm aware that it doesn't measure them ... but I'm wondering why? Surely that makes it Capital-W-Wrong.

Re: Adding seconds gets stuck

2005-11-20 Thread Dave Rolsky
On Sat, 5 Nov 2005, Mike Schilli wrote: Adding seconds to a date gets stuck when it reaches a leap second: use DateTime; my $dt = DateTime-new( year = 1972, month = 12, day = 31, hour = 23, minute= 59, second= 55, time_zone

Re: A sane answer for datetime subtraction?

2005-11-20 Thread Rick Measham
Dave Rolsky wrote: I think this is about as good as I can get it without simply forcing lots of additional complexity onto the user by adding many options to the API, which I am loathe to do. To sing my usual song: This looks great .. anyone who wants anything else should use something like