Re: PHP 4.0 Bug #7518: Rounding problems with mktime() or date()
| From: | Adam Trachtenberg | Date: | Mon, 30 Oct 2000 15:48:42 +0000 |
| Subject: | Re: PHP 4.0 Bug #7518: Rounding problems with mktime() or date() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-36413@lists.php.net to get a copy of this message | ||
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@student.net | http://www.student.com /