Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: time() question

by tachyon (Chancellor)
on Nov 23, 2004 at 04:18 UTC ( #409806=note: print w/ replies, xml ) Need Help??


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


Comment on Re: time() question
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://409806]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-12-26 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls