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: Intermediate:
Adding time in Perl .

 



perlwatcher
User

Feb 23, 2011, 5:44 AM

Post #1 of 3 (599 views)
Adding time in Perl . Can't Post

Hi All,

I am trying to add time to the existing time ... in terms of seconds.

For eg : If the current time is 13:40:47 and I want to add 45 seconds to it . how would I do it ..

I can use the grouping in the pattern matching ( like $1 and so on) to get the seconds hours and minutes ...but do we have any other way to the same....Like in the above example if the no of seconds after addition is more than 60 seconds .. I need to add 1 more minute ... so I want some module which does this...
I am aware of Date::Manip .. but not sure if it gives me precise time after addition

Please, any help would be greatly appreciated.

Thanks


BillKSmith
Veteran

Feb 23, 2011, 6:18 AM

Post #2 of 3 (595 views)
Re: [perlwatcher] Adding time in Perl . [In reply to] Can't Post

The module Date::Calc may be overkill, but it will do the job. Use its function Add_Delta_DHMS.
Good Luck,
Bill


perlwatcher
User

Feb 23, 2011, 6:32 AM

Post #3 of 3 (593 views)
Re: [BillKSmith] Adding time in Perl . [In reply to] Can't Post

Thank you very much ..

let me try and get back for help If I need any ..

 
 


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

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