in reply to How to find yesterdays date (was: Date)

There's always the old standby (joke) answer:
my $yesterdays_date = localtime; sleep 86400; print "Yesterday, it was $yesterdays_date\n";
And of course, this code breaks near the DST boundaries.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: How to find yesterdays date (was: Date)
by Tyke (Pilgrim) on Mar 12, 2001 at 18:04 UTC
    If you're going to dust this one off, you could also mention the standard optimisation:
    my $yesterdays_date = localtime; sleep 86400; print "Yesterday, it was $yesterdays_date\n"; sleep -86400;
    Yes, yes, I know it's sad...

    Update: Can't claim credit... I believe that belong to Ilya Zakharevich, otherwise it would have been even sadder, and I wouldn't've dared post.