in reply to How to convert time stamp to unix time ?
It can be as easy as:
Output: 1265184900use DateTime; $dt = DateTime->new( year => 2010, month => 2, day => 3, hour => 8, minute => 15, second => 0, nanosecond => 0, time_zone => 'UTC', ); print $dt->epoch;
Parsing your input string is left as an exercise for the reader.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|