APM: Unix time help

Mike Stok mike at stok.co.uk
Tue Sep 24 13:00:57 CDT 2002


On Tue, 24 Sep 2002, Goldilox wrote:

> I also want to convert dates to their corresponding Unix time.

Try a module like Time::Local or one of the date modules from CPAN.

NAME
       Time::Local - efficiently compute time from local and GMT
       time

SYNOPSIS
           $time = timelocal($sec,$min,$hour,$mday,$mon,$year);
           $time = timegm($sec,$min,$hour,$mday,$mon,$year);

DESCRIPTION
       These routines are the inverse of built-in perl functions
       localtime() and gmtime().  They accept a date as a six-
       element array, and return the corresponding time(2) value
       in seconds since the Epoch (Midnight, January 1, 1970).
       This value can be positive or negative.

Hope this helps,

(and sorry for the second post...)

Mike

-- 
mike at stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       | GPG PGP Key      1024D/059913DA 
mike at exegenix.com                  | Fingerprint      0570 71CD 6790 7C28 3D60
http://www.exegenix.com/           |                  75D2 9EC4 C1C0 0599 13DA




More information about the Austin mailing list