ID: 50697
Updated by: [email protected]
Reported By: cybermandanger at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux Red Hat Enterprise 5
PHP Version: 5.2.12
New Comment:
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.
08 is interpreted as an (invalid) octal number. Octal numbers start
with 0 and can only have the digits 0-7 in them.
Previous Comments:
------------------------------------------------------------------------
[2010-01-08 20:43:13] cybermandanger at gmail dot com
Description:
------------
Bug in mktime function parameters.
mktime function expects 7 numeric parameters. I´ve passed instead of 8
(whick is numeric) the value 08 (which is also numeric) but the shown
result is completly unexpected.
Example:
<?php
$intData = mktime(00,00,00,01,08,2010);
echo date("d/m/Y H:i:s", $intData);
?>
should print 08/01/2010 00:00:00 but is printing 31/12/2009 00:00:00.
Note: the problem occurs only with day parameter. if I send 08 in the
month parametes the result is right.
Reproduce code:
---------------
$intData = mktime(00,00,00,01,08,2010);
echo date("d/m/Y H:i:s", $intData);
Expected result:
----------------
08/01/2010 00:00:00
Actual result:
--------------
31/12/2009 00:00:00
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50697&edit=1