Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: How do I find difference between two timestamps?

by castaway (Parson)
on Nov 17, 2004 at 08:49 UTC ( [id://408334]=note: print w/replies, xml ) Need Help??


in reply to How do I find difference between two timestamps?

You could also skip all this 'figuring out what format that is, and passing it to something', and use a module that parses exactly what you have there, to wit: Time::ParseDate.
perl -MTime::ParseDate -le'print scalar localtime(parsedate("2004-11-1 +5T18:59:52.863Z"))'
Gives me:
Mon Nov 15 18:59:52 2004

Which looks good to me. So just run parsedate() on both, subtract the results, then all you'll need to do is convert the resulting number of seconds to something you understand ,)

C.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://408334]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-19 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found