ID: 28705 Updated by: [EMAIL PROTECTED] Reported By: ransico at iinet dot net dot au -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: windows, unix PHP Version: Irrelevant New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Unix Timestamps are always in GMT, so this is the expected behavior. Previous Comments: ------------------------------------------------------------------------ [2004-06-09 03:30:27] ransico at iinet dot net dot au Description: ------------ Hi, I have been tearing my hair out about this - until I discovered the underlying problem when I wrote the test code below. The problem occurs in version 4, aswell as the latest v5 CVS. I have tried on redhat linux and windows XP. When the server is in a non GMT timezone, you would expect gmdate and date to produce different times - and they normally do so. however, when you ask the format to be 'U' (timestamp), gmdate appears to produce the incorrect result - it does NOT take into account that it is supposed to make a GMT result. The code I attached shows the contradiction in the results of gmdate and date, when using a timestamp, and normal formatting. Note, the anomolies only appear in timestamps. Is this intentional? if so, it is very odd behaivour. Reproduce code: --------------- print "<br>" . gmdate('U'); print "<br>" . date('U'); print "<br>" . gmdate('g:ia \o\n D d<\sup>S</\sup> M, Y'); print "<br>" . date('g:ia \o\n D d<\sup>S</\sup> M, Y'); Expected result: ---------------- 1086707744 1086743744 1:15am on Wed 09th Jun, 2004 11:15am on Wed 09th Jun, 2004 Actual result: -------------- 1086743744 1086743744 1:15am on Wed 09th Jun, 2004 11:15am on Wed 09th Jun, 2004 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28705&edit=1
