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

Adam Trachtenberg wrote:
>
> 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. :)
>

So what should a poor boy do to do date arithmetics? Since there are no
functions to do calculations on Julian days in PHP, what would you
suppose? I fear I will have to rewrite quite some code in which I
assumed a constant day length.

s.
------------------------------------
Sascha Mantscheff Bruenglinghausen
                  D-51588 Nuembrecht
                Fon +49-171-620 0380
                   Fax +49-2291-3841
        e-Mail sascha <email protected>
------------------------------------

-- 
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>