|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-03-26 12:31 UTC] eschmid@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 14:00:01 2025 UTC |
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