#28705 [Opn->Bgs]: gmdate and date odd behaivour
| From: | derick@php.net | Date: | Wed, 09 Jun 2004 07:40:03 +0000 |
| Subject: | #28705 [Opn->Bgs]: gmdate and date odd behaivour | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-60622@lists.php.net to get a copy of this message | ||
ID: 28705
Updated by: derick@php.net
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