Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How do I find difference between two timestamps?

by castaway (Parson)
on Nov 17, 2004 at 08:49 UTC ( #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? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2022-01-24 16:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (64 votes). Check out past polls.

    Notices?