ID:               32640
 User updated by:  chris at deskpro dot com
 Reported By:      chris at deskpro dot com
 Status:           Bogus
 Bug Type:         Date/time related
 Operating System: Linux / Windows
 PHP Version:      4.3.9
 New Comment:

I have been checking the bugs and the only ones I can find are about
documentation errors, a direct DST issue (when gmmktime is wrong by a
single hour) etc.

I can't find a bug that suggests the function is completly broken,
which this bug seems to suggest.

I also can't find a bug report that suggests the feature works
PERFECTLY in PHP 5 but not in PHP 4. Is there a reason why the working
code in PHP 5 can not be put into PHP 4.

I also still don't know which function is actually buggy. Is it date()
or gmmktime(); ?

Given that echo (mktime() - gmmktime()) / (60 * 60); it seems
gmmktime() is working, the difference shown is corect; so is it date()
that is broken? but there certainly seems to be no date() functions.

Perhaps you can recommend the manual is updated to show which function
is currently unusable?


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

[2005-04-09 02:35:51] [EMAIL PROTECTED]

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Try search bugs once before reporting this issue for the 100th time..


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

[2005-04-09 02:33:47] chris at deskpro dot com

I will add I get different wrong resuls (but always wrong) based on the
DST setting.

This is only tested on Windows. I am in -8 GMT (PST)

with no dayling savings time (-8 PST) the last result is

NOW - 8 hours (instead of NOW + 8 hours)

When I enable DST (now in PDT) I get

GMT - 2 hours OR NOW + 6 hours

In the 1st one, the difference (8 hours) has been taken away instead of
added; this is probably someone just using a - instead of a +

The problem when DST is enabled I have much less of an idea about.

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

[2005-04-09 02:16:34] chris at deskpro dot com

Description:
------------
Please run the reproduce code:

In PHP 4.3.9 (windows) and PHP 4.3.7 (linux) I get the same result. 3
results are displayed in local time, 2 are in GMT and 1 (the bottom
one) is meaningless.

It appears that PHP is taking the hours off, not adding them in. I do
not know if this is a bug in date or gmmktime.

Importantly, this does NOT happen in PHP 5, this is what convinced me
this is a bug.

Reproduce code:
---------------
echo "<table>";
echo "<tr><td>gmdate('D, jS M Y g:i a') : </td><td>" . gmdate('D, jS M
Y g:i a') . "</td></tr>";
echo "<tr><td>date('D, jS M Y g:i a'); : </td><td>" . date('D, jS M Y
g:i a') . "</td></tr>";
echo "<tr><td>gmdate('D, jS M Y g:i a', mktime()); : </td><td>" .
gmdate('D, jS M Y g:i a', mktime()) . "</td></tr>";
echo "<tr><td>gmdate('D, jS M Y g:i a', gmmktime()); : </td><td>" .
gmdate('D, jS M Y g:i a', gmmktime()) . "</td></tr>";
echo "<tr><td>date('D, jS M Y g:i a', mktime()); : </td><td>" .
date('D, jS M Y g:i a', mktime()) . "</td></tr>";
echo "<tr><td>date('D, jS M Y g:i a', gmmktime()); : </td><td>" .
date('D, jS M Y g:i a', gmmktime()) . "</td></tr>";
echo "</table>";

Expected result:
----------------
The results should be:

GMT
Local
GMT
Local
Local
GMT

Actual result:
--------------
GMT
Local
GMT
Local
Local
Meaningless


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


-- 
Edit this bug report at http://bugs.php.net/?id=32640&edit=1

Reply via email to