You've discovered a problem with daylight savings time, as the dates you
found are the end of DST (at least in the US) when we set our clocks back an
hour. I suspect you'll find 23 hour days in April.

-david

<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> From:             [EMAIL PROTECTED]
> Operating system: freebsd 4.2
> PHP version:      4.0.4pl1
> PHP Bug Type:     Date/time related
> Bug description:  mktime() calculation error - 25 hours in a day
>
> using mktime() one day per year has 25 hours in it
> if you substract one date from the previous day and divide
> by 3600 you should find there are 24 hours in that day.
> however, one day per year has 25 hours.
> so far i have found one day per year.
> and a different day every year.
>
> 10/29/2000    25 hours
> 10/28/2001    25 hours
> 10/27/2002    25 hours
>
> to reproduce the problem:
>
> (mktime(0,0,0,10,30,2000)-mktime(0,0,0,10,29,2000))/3600
>
> (mktime(0,0,0,10,29,2001)-mktime(0,0,0,10,28,2001))/3600
>
> (mktime(0,0,0,10,28,2002)-mktime(0,0,0,10,27,2002))/3600
>
> i found the problem because i was creating date ranges for
> the user and putting them into a database. if i add the
> number of days in a month to a date, i should then have the
> same numeric date in the new month. for instance convert
> 08/10/2001:
> $new_day = mktime(0,0,0,8,10,2001) + ( 31 * 86400 )
>  ( 31 number of days in august )
>  ( 86400 seconds in a day )
> convert back to date  date("Y-m-d", $new_day )
> should and does = 09/10/2001
>
> i have now tried this on two different servers.
> one - PII 350 freebsd 4.2, apache 1.3.17, php 4.0.4pl1
> two - PIII 667 freebsd 4.2, apache 1.3.17, php 4.0.4pl1
>
> both return the same problem
>
> thanks for any insight
> James Lose  03/26/2001
>
>
> --
> Edit Bug report at: http://bugs.php.net/?id=9998&edit=1
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to