I'm trying to calculate the number of seconds between "now" and an ISO8601 date
So far I have the following code,
It's not working, so can someone suggest a working/better/more efficient way?use Time::Local; $start = '2013-10-28T18:59:52.863Z'; @parts = $start =~ /^(.{4})-(.{2})-(.{2})T(.{2}):(.{2}):(.{2})\.(.{3}) +Z$/; $start_secs = pop(@parts) / 1000; $start_secs += timegm reverse @parts; print "start_secs : $start_secs\n"; $end=timegm(gmtime()); print "end_secs : $end_secs\n"; $diff = $end_secs - $start_secs; print "$diff";
In reply to time difference calculation by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |