in reply to time() question
The shortest module that does this is Time::Local. This conversion is basically all it does.
use Time::Local; $time = timelocal($sec,$min,$hour,$mday,$mon,$year); $time = timegm($sec,$min,$hour,$mday,$mon,$year); my ( $mday, $mon, $year ) = split '/', "01/12/2008"; $mon -= 1; # Time::Local uses months 0..11 like gmtime() and localti +me(). my $epoch_time = timegm(1,0,0,$mday,$mon,$year); # 1 second past midni +ght
cheers
tachyon
|
---|