How do I convert a date/time to epoch time in Perl?
- by dreeves
Given a date/time as an array of (year, month, day, hour, minute, second), how would you convert it to epoch time, i.e. the number of seconds since 1970-01-01 00:00:00 GMT?
Bonus question: If given the date/time as a string, how would you first parse it into the (y,m,d,h,m,s) array?