I think you want to add "1" to month and add 1900 to year not subtract.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 02, 2002 4:58 AM
To: [EMAIL PROTECTED]
Subject: Convert date to epoch


Hi!

I have this problem. Im trying to convert dates to epoch time using
Time::Local

$fn=timelocal($seconds,$minutes,$hours,$day,$month-1,$year-1900);

It works great if year is after 1970, but it throws a 'Can't handle date'
error if year is before 1970.

I asume this is because epoch time counts from 1/1/1970.

Is there another way to convert this?


Thanks in advance,
Mauricio

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe:
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to