From: chris at deskpro dot com
Operating system: Linux / Windows
PHP version: 4.3.9
PHP Bug Type: Date/time related
Bug description: Bug in either date of gmmktime
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 bug report at http://bugs.php.net/?id=32640&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32640&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32640&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32640&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32640&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32640&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32640&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32640&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32640&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32640&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32640&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32640&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32640&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32640&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32640&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32640&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32640&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32640&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32640&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32640&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32640&r=mysqlcfg