Em Qui, 2009-02-19 às 15:58 -0800, Larry Wall escreveu:
> That being said, I'm thinking that all actual times represented by
> floats in Perl are TAI time, not the Unix pseudo time with hidden
> leap seconds.  I sure wish they'd done away with civic leap seconds
> in 2000 and said we'll put in a leap minute or two on century breaks...

I beg to disagree.

If we're going to use an epoch, it should be the Operating System's
epoch. Anything else will lead to confusion and disorder ;P

OTOH, what has been argued here (and I agree) is that epoch doesn't
provide semantics that *were supposed to be taken into account* in most

For instance, if you want to add "1 day" using an epoch, you'd think
that adding 86400 seconds should do the trick, but that only works if
you're not planning any conversions between timezones, because there are
days with 23 and days with 25 hours. I once fixed a code like the

my $reference = time;
my $month = (localtime($now))[4];
while ((localtime($now))[4] == $month) { $reference += 86400 };

The only viable solution is to use a module that provides the proper
semantics (and I insisit that DateTime is that module, currently).

The above operation is far from being an exotic operation. That kind of
thing is indeed very common. 

The argument in this thread is exactly about making the basic operations
that involve time (time, localtime, gmtime, stat) to return a DateTime
object that implements all the semantics involved in DateTime
operations. IMNSHO, the DateTime module in CPAN is the reference to be
used in that matter.


Reply via email to