From: tlii_php at bsb dot cz
Operating system: Linux
PHP version: 4.3.2
PHP Bug Type: Date/time related
Bug description: mktime(); and gmmktime(); using "xx" parameter
Description:
------------
When is for mktime(); used month parameter in form "xx", then in some
cases it appears to produce incorrect output ( timestamp ).
Same situation in gmmktime();
Reproduce code:
---------------
$test1 = mktime(22,00,00,07,01,2003);
$test2 = mktime(22,00,00,08,01,2003);
$test3 = mktime(22,00,00,8,01,2003);
$test4 = mktime(22,00,00,09,01,2003);
$test5 = mktime(22,00,00,9,01,2003);
$test6 = mktime(22,00,00,10,01,2003);
$test7 = gmmktime(22,00,00,8,01,2003);
$test8 = gmmktime(22,00,00,08,01,2003);
echo date("j.m.Y H:i", $test1 )." -- mktime(22,00,00,07,01,2003); <br>";
echo date("j.m.Y H:i", $test2 )." -- mktime(22,00,00,08,01,2003); <br>";
echo date("j.m.Y H:i", $test3 )." -- mktime(22,00,00,8,01,2003); <br>";
echo date("j.m.Y H:i", $test4 )." -- mktime(22,00,00,09,01,2003); <br>";
echo date("j.m.Y H:i", $test5 )." -- mktime(22,00,00,9,01,2003); <br>";
echo date("j.m.Y H:i", $test6 )." -- mktime(22,00,00,10,01,2003);
<br><br>";
echo date("j.m.Y H:i", $test7 )." -- gmmktime(22,00,00,8,01,2003); <br>";
echo date("j.m.Y H:i", $test8 )." -- gmmktime(22,00,00,08,01,2003); ";
Actual result:
--------------
1.07.2003 22:00 -- mktime(22,00,00,07,01,2003);
1.12.2002 22:00 -- mktime(22,00,00,08,01,2003);
1.08.2003 22:00 -- mktime(22,00,00,8,01,2003);
1.12.2002 22:00 -- mktime(22,00,00,09,01,2003);
1.09.2003 22:00 -- mktime(22,00,00,9,01,2003);
1.10.2003 22:00 -- mktime(22,00,00,10,01,2003);
2.08.2003 00:00 -- gmmktime(22,00,00,8,01,2003);
1.12.2002 23:00 -- gmmktime(22,00,00,08,01,2003);
--
Edit bug report at http://bugs.php.net/?id=25050&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25050&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25050&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25050&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25050&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25050&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25050&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25050&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25050&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25050&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25050&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25050&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25050&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25050&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25050&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25050&r=gnused