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

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

Thread Previous | Thread Next
Nathan Wiger
September 4, 2000 13:09
Re: RFC 99 (v2) Standardize ALL Perl platforms on UNIX epoch
Message ID:
Chaim Frenkel wrote:
> Strange thought just crossed my mind.
> Would having a time object that is understood by perl be sufficient?
> It would smell and taste like an integer but would otherwise be
> magical.

This is something that should be easily doable if RFC 73, "All Perl core
functions should return objects", gets adopted. Then we could easily
have time() return an object which, when in a numeric or string context,
evaluates to the UNIX epoch seconds. But it could easily have object
methods like:

   $t = time;       # Generate time object
   print $t;        # UNIX epoch
   $t++;            # UNIX epoch + 1

   $t->mjdate;      # Modified Julian Date
   $t->systime;     # System time
   $t->unix;        # UNIX epoch, same as NUMBER and STRING
   $t->judaic;      # You get the idea... :-)

Embedded objects are looking better all the time...


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About