CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
difference in between two timestamps in perl

 



giridhar276
Novice

Jun 13, 2013, 8:38 PM

Post #1 of 4 (448 views)
difference in between two timestamps in perl Can't Post

How to find the difference in between two dates with time?

Eg

$time1="06/14/2013 13:30";
$time2="06/15/2013 17:30";

And the output should be in minutes in between those dates.

I am struggling to find the module to calculate the minutes

Could anyone please let me know how to proceed with the above...

Tons of thanks....!!


FishMonger
Veteran / Moderator

Jun 13, 2013, 8:56 PM

Post #2 of 4 (445 views)
Re: [giridhar276] difference in between two timestamps in perl [In reply to] Can't Post

Take a look at the Date::Calc and DateTime modules.

http://search.cpan.org/~stbey/Date-Calc-6.3/lib/Date/Calc.pod
http://search.cpan.org/~drolsky/DateTime-1.03/lib/DateTime.pm


giridhar276
Novice

Jun 13, 2013, 9:02 PM

Post #3 of 4 (442 views)
Re: [FishMonger] difference in between two timestamps in perl [In reply to] Can't Post

Tons of thanks FishMonger...

But none are matching my requirment to have the difference in minutes.

If possible COuld you pleaes elaborate with any function..

Once again thanks ...


FishMonger
Veteran / Moderator

Jun 13, 2013, 9:34 PM

Post #4 of 4 (436 views)
Re: [giridhar276] difference in between two timestamps in perl [In reply to] Can't Post

You can use the Delta_DHMS function in Date::Calc to get the individual values and use those numbers to calculate the total minutes.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives