in reply to 24 hours ago localtime

How accurately do you want that "24 hours" to be?

perl> print scalar localtime;; Wed Dec 7 02:30:59 2005 perl> print scalar localtime( time() - 24*60*60 );; Tue Dec 6 02:31:01 2005

This works okay, but it may not account for things like summertime, leap days etc.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: 24 hours ago localtime
by Anonymous Monk on Dec 07, 2005 at 02:58 UTC
    Oh, I don't care if that 24 hours is sometimes 25 or 26. I just need it to generally round down to 24 hours (with leapyears and other special events, if it doesn't crash it'll still be acceptable).

    Thank you.