Re: [PHP-DEV] PHP 4.0 Bug #7518: Rounding problems with mktime() or date() From: Adam Trachtenberg (adam <email protected>)
Date: 10/30/00

On Sun, 29 Oct 2000, Zeev Suraski wrote:

> ><?php
> > $DAYS = 3600 * 24;
> > $fdom = mktime( 0, 0, 0, 10, 8, 2000 );
> > for ($i = 1; $i < 30; $i++)
> > echo date( "d.m.Y", $fdom + ($i - 1) * $DAYS ) . " ";
> >?>
> >
> >This script should list the day number from October, 08th, through the
> >next 30 days. It repeats the 29th day of October. I don't know why.
>
> My guess is that it's due to daylight saving issues. Any chance there's a
> switch between standard time to daylight time (or the other way around) on
> this date?

This is correct. Relying on the amount of hours in a day to be a constant
is a bad thing to do. :)

Also, relying on where and/or when daylight savings will / won't occur is
also a bad idea. (See Australia, 2000 where the governemnt altered the
regular date as to not disrupt the Olympics.)

-adam

-- 
/ adam maccabee trachtenberg | visit college life online \
\ adam <email protected>           | http://www.student.com    /

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>