Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Calculating Difference In Dates

by ambrus (Abbot)
on Apr 18, 2014 at 10:35 UTC ( [id://1082741]=note: print w/replies, xml ) Need Help??


in reply to Calculating Difference In Dates

I recommend the Date::Manip module.

my $date1 = "2014/01/25 23:11:14"; my $date2 = "2014/01/26 00:30:37"; use Date::Manip::Date 6.23; my $do1 = Date::Manip::Date->new($date1); my $do2 = $do1->new($date2); my $delta = $do1->calc($do2); # If you want a human-readable string: print $delta->printf("The difference is %mym minutes, %sss seconds.\n" +); # If you want the number of minutes and seconds as separate numbers: my($delta_min, $delta_sec) = $delta->printf("%mym", "%sss");

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-23 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found