Re: [PHP-DEV] PHP 4.0 Bug #7518: Rounding problems with mktime() or date() From: Zeev Suraski (zeev <email protected>)
Date: 10/29/00

At 12:56 29-10-00, sascha <email protected> wrote:
>From: sascha <email protected>
>Operating system: SuSE Linux 6.4
>PHP version: 4.0.1pl2
>PHP Bug Type: Date/time related
>Bug description: Rounding problems with mktime() or date()
>
><?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?

>If the 3rd line is changed to
> $fdom = mktime( 0, 0, 0, 10, 08, 2000 );
>date counting starts on September 30th, so the leading 0 of "08" is
>misinterpreted as a standalone zero.

I don't think that's related, if it is, I haven't understood your bug
report. Numbers with leading zeros are treated as octals. Since
there's no '8' digit in the octal base, '08' ends up being treated as
0. It's the expected behavior.

Zeev

--
Zeev Suraski   <zeev <email protected>>
http://www.zend.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>