Just another Perl shrine | |
PerlMonks |
Re: How to convert time in perl?by fokat (Deacon) |
on Jun 05, 2003 at 12:50 UTC ( [id://263302]=note: print w/replies, xml ) | Need Help?? |
I don't know what kind of representation is that you mention. The customary way to represent time at the OS level, is the number of seconds elapsed since Jan 1 1970 00:00:00 (the Epoch). This is, for instance, what time() returns. I guess you can get your conversion by using some snippet such as:
localtime() in a scalar context, will give you a nicely formatted string such as:
In an array context, it will return the components of the date stamp. Please check your friendly perldoc -f localtime for the details. Best regards -lem, but some call me fokat
In Section
Seekers of Perl Wisdom
|
|