At 16.09 -0500 1998.12.04, Geoffrey C Kinnel wrote: >I tried > >print scalar (localtime(-1)); > >on a Unix machine and got 1 second before epoch. > >If I try the same on Macperl, I just get the epoch, unmodified. > >Is this a known behavior? Can I get dates before Jan 1, 1904 using >localtime()? The difference is because Mac OS uses an unsigned 32-bit integer, and so no, it cannot go back before Jan 1, 1904. The ranges on Unix are from -2**31 to 2**31, and for Mac OS are 0 to 2**63. RedHat Linux, 2.1.129, perl5.004_04: % perl -le 'print scalar localtime(-1 - 2**31)' Fri Dec 13 15:45:52 1901 % perl -le 'print scalar localtime( - 2**31)' Fri Dec 13 15:45:52 1901 % perl -le 'print scalar localtime( 1 - 2**31)' Fri Dec 13 15:45:53 1901 % perl -le 'print scalar localtime( 2**31)' Fri Dec 13 15:45:52 1901 % perl -le 'print scalar localtime(-1 + 2**31)' Mon Jan 18 22:14:07 2038 MacPerl 5.2.0r4 PPC, Mac OS 8.5: #!perl -l print scalar localtime(-1 - 2**0); print scalar localtime( - 2**0); print scalar localtime( 2**63); print scalar localtime(-1 + 2**63); Returns: Fri Jan 1 00:00:00 1904 Fri Jan 1 00:00:00 1904 Mon Feb 6 06:28:15 2040 Mon Feb 6 06:28:15 2040 -- Chris Nandor mailto:pudge@pobox.com http://pudge.net/ %PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6']) ***** Want to unsubscribe from this list? ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch