[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Y2K perl snag!




On Sun, 2 Jan 2000, Ira Abramov wrote:

> ($sec,$min,$hour,$mday,$month,$year) = localtime(time);
> print $year."\n";
> 
> you get: 100!

in perl 4 (v4.036), there used to be a librarry function named
'timelocal', which makes the reverse translation (i.e. from
year+month+day+hour+minute+second into # of seconds since Jan 1 1970).
if fed dates beyond 1999, the function would enter an endless loop.

i hope it was fixed in perl 5. our solution at the time was to write our
own version of 'timelocal', rather then trying to fix the original source
(which is not a very clear piece of code to begin with).

if osmeone else here still uses perl4 and needs this code, let me know,
and i'll mail it to you. i _assume_ there will be no replies to this offer
:)

guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy


=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il