in reply to how to calculate time that looks like 1138597506
It's called epoch time, the number of seconds since Jan 1st, 1970.
>perl -le "print scalar gmtime 1138597506 Mon Jan 30 05:05:06 2006
To convert to epoch time, you can use core module Time::Local's timegm or timelocal.
To make changes, you should use Date::Calc.
To render into a human-readable format, POSIX's strftime (in conjunction with localtime or gmtime) should do the trick.
Time::ParseDate might be of use if you want to avoid the dropdowns.
Update: Rearranged order of text. Added last paragraph.
|
|---|