Why does time() return a multiple of 60? Surely each time there's a leap
second time()%60 should increment?
Cheers!
Rick Measham
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!
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
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
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.
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
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