On Jul 29, 2004, at 8:32 AM, Janet Marie Jackson wrote:

     Take a look at Time::Local, which has timelocal() and timegm()
functions:
        http://cpan.uwinnipeg.ca/module/Time::Local

On MacOS X, timelocal() fails if you give it a date before December 17, 1901. I don't know what's special about that date.


#!/usr/bin/perl
use Time::Local qw(timelocal);
my ($year, $mon, $day) = @ARGV;
print timelocal(0,0,0,$day,$mon-1,$year),"\n";

% ./timetest.pl 1900 1 1
Cannot handle date (0, 0, 0, 1, 0, 1900) at ./timetest.pl line 4

% ./timetest.pl 1901 1 1
Cannot handle date (0, 0, 0, 1, 0, 1901) at ./timetest.pl line 4

% ./timetest.pl 1901 12 16
Cannot handle date (0, 0, 0, 16, 11, 1901) at ./timetest.pl line 4

% ./timetest.pl 1901 12 17
-2147194800

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to