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

Re: [MacPerl] Millenium Bug (was: re: newbie alert :-) question on the datething...)



At 07.56 8/15/97, Alex Satrapa wrote:
>At 16:46 +1000 on 15/8/97, Paul Evad wrote:
>>  $parse{"y"}=$year;
>>  if($year>67) {$parse{"Y"}="19$year"} else {$parse{"Y"}="20$year"};
>>  #get day
>
>Which of course prompts me to ask... is it Unix, MacOS, Perl or MacPerl
>that limits the year to 2 digits?

None of the above.  It is Paul.  :-)

Perl returns the number of years since 1900.  The year 200 will be
represented by the number 100.

The above should read something like:

  $parse{"y"}=$year;
  $parse{'Y'}=$year + 1900;

This will work until at LEAST 2038, when 32-bit integers run out on UNIX
machines, and until about 2040 on Macs.  That's assuming no one fixes Perl
to deal with the 64-bit date, which seems silly.

--
Chris Nandor             pudge@pobox.com             http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch