>> Is Perl currently using different epochs on different platforms?  If so, I
>
> Yes.  MacOS and VMS.  (Though VMS' localtime() uses the UNIX definition,
> just to be portable.)  MacOS' epoch zero is 1900 (or was it 1901?),
> VMS' epoch zero is 17-NOV-1858 00:00:00.00, for some astronomical
> reason IIRC.

  perlfunc states that time() returns seconds since machine epoch,
noting that it varies from platform to platform.  (As some have noted,
the Mac epoch is in 1904.  I think this is so you can divide the years
since epoch by 4 and have the remainder indicate the leap-year
condition.  Wouldn't have worked for 1900, and most of us have
probably dealt with that fact at some point, by now.)

  It might be advisable for portability concerns to standardize on an
epoch.  If so, this Mac user would vote for the UNIX epoch.  It is
simply the most widely accepted.  I'm not sure what Windows does, but
I thought I might have seen something that implied it was using (or at
least converting to and from) UNIX epoch.  Mac will probably use that
epoch, anyway, once OS X comes out (which will fuse Mac OS and UNIX in
what I expect will be a beautiful way).

  I always treat the return value of time() as a black-box value.  I
can perform specific actions on it, such as feeding it to localtime()
or adding relative time intervals to it, such as a year of seconds.
But I do not allow myself to look at that value.  I was kind of hoping
Perl6 would formalize this into a black-box value, meaning an object,
and offload everything into a standard module instead of the core.


  Kirrily and Dan, isn't it time for a time and date sublist?

J. David

Reply via email to