ID: 27909 Updated by: [EMAIL PROTECTED] Reported By: cryogen at mac dot com -Status: Open +Status: Feedback Bug Type: Date/time related Operating System: Mac OSX 10.3.3 PHP Version: 4.3.4 New Comment:
Give the feedback when you have it, thank you. Previous Comments: ------------------------------------------------------------------------ [2004-04-12 18:18:18] cryogen at mac dot com Waiting to get a build from the latest CVS snapshot to see if this corrects the problem. This may take a while, as I do not build this myself, but depend on the build from Marc Liyanage www.entropy.ch. ------------------------------------------------------------------------ [2004-04-07 14:25:28] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2004-04-07 13:03:07] cryogen at mac dot com Description: ------------ MacOSX 10.3.3 - PHP 4.3.4 (entropy.ch), California PST I searched through the existing bug submissions, but did not find anyone reporting this specific problem on Mac OSX, so here it is. I am using dates stored as GMT dates in order to provide my users across the world with accurate date- times in their local time zones (using timezone offsets to GMT). During the changover to daylight savings time on April 4, 2004 I ran into what I think is a bug with gmmktime(). Here is the code snippet: Reproduce code: --------------- <?php $td = gmmktime(2,0,0,4,4,2004); echo "<p>April 4, 2004 - 02:00 am<br/>"; echo "GMDATE = ".gmdate("m/d/Y H:i:s (g:i a)",$td)."<br/>"; echo "DATE = ".date("m/d/Y H:i:s (g:i a)",$td)."<br/>"; ?> Expected result: ---------------- What I expected to see for the GMDATE result was the same date I input in gmmktime() - "04/04/2004 02:00:00 (02:00 am)". Actual result: -------------- What I am actually getting is: "GMDATE = 12/31/1969 16: 58:58 (4:58 pm)", or an invalid result. Since gmmktime() is supposed to take GMT date input parameters as per the documentation, 2:00 am on April 4th is valid, since GMT does not have daylight savings time and should not have any code to deal with DST. It seems like it is behaving the same as mktime() which does not deal with the one hour we "spring forward" during daylight savings time (that hour essentially does not exist). NOTE#1: I tested this on Windows XP with PHP 4.3.4, Pacific time zone and got the result "04/04/2004 01:00:00 (01:00 am)" which is better, but still wrong. since gmmktime should not adjust the time at all for GMT, especially not in the wrong direction!. NOTE #2: I also tested this on Solaris with PHP 4.3.4, Pacific time zone and got the same result as Windows of 04/04/2004 01:00:00 (01:00 am). NOTE #3: I also tested this on Redhat 9.0, PHP 4.3.6 in Central Standard Time and got a result of 04/04/2004 03: 00:00 (03:00 am)? This one seems to be adjusting for DST (although it should be 4:00am) even though it should not. NOTE #4: I also tested this on a Redhat Linux Machine (v.9.0 PHP 4.3.4 Mountain Standard Time) and got the correct result of "04/04/2004 02:00:00 (02:00am)", although I fear this is because of the time being set to 01:00am and then adjusted to 2:00am for DST Mountain time (again, wrong). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27909&edit=1
