develooper Front page | perl.perl6.language.datetime | Postings from September 2000

Re: RFC 99 (v3) Standardize ALL Perl platforms on UNIX epoch

From:
Nathan Wiger
Date:
September 16, 2000 11:19
Subject:
Re: RFC 99 (v3) Standardize ALL Perl platforms on UNIX epoch
Message ID:
39C3B78C.F71A3508@wiger.org
> Standardize ALL Perl platforms on UNIX epoch

I've seen lots of discussion on this, and there have been 2 previous
versions worth of discussion as well. The first version of this was
actually entitled:

   "Maintain internal time in Modified Julian (not epoch)"

but that got shot down so fast it wasn't even funny.

I think Chuck hit the nail on the head with this:

    I've been in the Epoch !=0 mode and it sucked.  I vote for
    Epoch=0 as the default.

The overwhelming consensus in the previous discussions was:

   1. There are problems with every epoch. *EVERY* epoch.

   2. Optimize for Perl.

Now, one thing that should probably be explored is creating a time
object, similar to the date object specified in RFC 48. In fact, I'd
just assume "All Perl core functions should return objects", and hence
the reason I wrote RFC 73. ;-)

Seems to me something like this:

   $t = time;        # time object

   $t++;             # ->NUMBER, same as ->unix
   print "$t";       # ->STRING, same as ->iso

   $t->unix          # UNIX epoch seconds
   $t->iso           # ISO format
   $t->native        # native epoch, whatever that may be

Kicks ass. 64 bits should be used wherever possible. The time object can
be passed anywhere and everywhere, and builtin functions know which
member methods to call to get what they want.

This is the type of power I'd like in Perl 6. Just looking at it make me
giddy. Thoughts?

-Nate



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About