Re: using perl to print yesterday's date, but with formatting options ?



Purl Gurl wrote:

> All-in-all, you have yet to receive any intelligent responses
> regarding Daylight Savings Time.
>
> On Daylight Savings Time, you will never write code which
> will work correctly.

I beg to differ on both points. I posted this reply:
http://tinyurl.com/8uwwb. It works for daylight savings time, and leap
years, and Y10K, and years ending in "00" and it won't necessarily
break in Autumn of 2037, and everything else.

Simple:

use Date::Manip;
my $yesterday = UnixDate('yesterday', "%d.%m.%y");

If this solution does not meet the OP's requirements while avoiding the
pitfalls of cronowackiness, I'd like to know in what scenario it would
fail.

--
http://DavidFilmer.com

.