Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: time difference

by mifflin (Curate)
on Aug 01, 2005 at 04:44 UTC ( #479788=note: print w/replies, xml ) Need Help??


in reply to time difference

assuming you had two different epoch times $t1 and $t2 you could...
$diff = $t2 - $t1; $ss = $diff % 60; $diff = ($diff - $ss) / 60; $mi = $diff % 60; $hh = ($diff - $mi) / 60; sprintf("%d:%02d:%02d" , $hh, $mi, $ss);
This gives hours:minutes:seconds. I'll leave it as an exercise for you to add the days calculation.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2022-08-09 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?