Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
The stupid question is the question not asked
 
PerlMonks  

Re: time ()

by clintp (Curate)
on Dec 05, 2001 at 14:49 UTC ( [id://129632]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to time ()

So essentially: you're subtracting the start time from the current time, both expressed in seconds. The result is a pile of seconds that then need to be translated to days, hours, minutes and leftover seconds. Right?

The DateCalc function in the Date::Manip module would do this. Beware, this is a heavyweight module. It might just be quicker to divide by 86400 (days), take the remainder and divide by 60*60 (hours), take the remainder and divide by 60 (minutes), and what's left is seconds.

Replies are listed 'Best First'.
Re: Re: time ()
by Fastolfe (Vicar) on Dec 05, 2001 at 20:09 UTC
    Implementers should note that a simple solution like this, while simple and usually perfectly adequate, will break with 'day', 'month' or 'year' labels across:
    • Daylight Savings Time boundaries
    • Month boundaries (given that months have varying days)
    • Leap Year boundaries

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://129632]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.