Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Difference in times (in minutes)

by zejames (Hermit)
on Dec 13, 2004 at 20:52 UTC ( #414541=note: print w/replies, xml ) Need Help??


in reply to Difference in times (in minutes)

Using DateTime, that I prefer to Date::Calc, finding it much more clear to code :
use DateTime; $dt1 = DateTime->new(year => 2004, hour => 16, minute => 54, second => 23); $dt2 = DateTime->new(year => 2004, hour => 16, minute => 54, second => 28); # Beware : $diff is a DateTime::Duration object # (which is logical if one think about it...) $diff = $dt2 - $dt1; print $diff->hours, ":", $diff->minutes, ":", $diff->seconds, "\n";

HTH


--
zejames

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2020-10-26 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (250 votes). Check out past polls.

    Notices?