ID: 9998
Updated by: eschmid
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: Date/time related
Assigned To: 
Comments:

Thats not an bug. You can find another day in the year which have 23 hours. It's the 
day light saving.

Previous Comments:
---------------------------------------------------------------------------

[2001-03-26 12:05:13] [EMAIL PROTECTED]
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

---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9998&edit=2


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