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 06, 2001 at 01: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