>Yes.  There are 2 hours each year when this formula is wrong.

I assume you're thinking of the switch from DST to CST and vice-versa, 
yes?  But since that change occurs at oh-dark-hundred (2:00AM), it's 
already "today," and "yesterday" would be the same, wouldn't it? Or is it 
a different pair of hours you're referring to?

More seriously, isn't this code subtracting a day twice?

>>>> my ($mday, $mon, $year) = (localtime(time() - 60 * 60 * 24) )[ 
3,4,5];
>>>> printf("%d/%02d/%02d\n", $year + 1900, $mon + 1, $mday - 1);

I would think that the first, subtracting from time() would be the correct 
one--the one that would overcome changes in month, year, and time, while 
the second, from $mday's value, is not just redundant, but at this point, 
wrong, no? Not only that, it would introduce such curiosities as the 
zero-th day of each month--the day before the first of a month. 

On a picky note, wouldn't it be easier to just subtract 86400?

Deane Rothenmaier
Programmer/Analyst
Walgreens Corp.
224-542-5150

The chief cause of problems is solutions. - Eric Sevareid
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to