Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Re: Time

by chipmunk (Parson)
on Dec 03, 2001 at 09:31 UTC ( #129040=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Time
in thread Converting date to epoch time

The name of the module is Time::Local, with the T and the L uppercase. Case is significant in module names. Fix that, and the code should work. You can test it with localtime:
#!perl -l use Time::Local; $sec = 1; $min = 2; $hours = 3; $mday = 4; $mon = 5; $year = 6; print $time = timelocal($sec,$min,$hours,$mday,$mon,$year); print scalar localtime $time;
Which prints out:
1149404521 Sun Jun 4 03:02:01 2006
timelocal does some guessing on the year; it figured that 6 meant 2006. Also remember that the month starts at 0, so 5 is June.

Replies are listed 'Best First'.
Re: Re: Re: Re: Time
by Anonymous Monk on Dec 03, 2001 at 09:40 UTC
    chipmunk, Thank you very much. Kev

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://129040]
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 2020-01-18 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?