|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50697 BUG mktime function
Submitted: 2010-01-08 20:43 UTC Modified: 2010-01-08 21:14 UTC
From: cybermandanger at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.12 OS: Linux Red Hat Enterprise 5
Private report: No CVE-ID: None
 [2010-01-08 20:43 UTC] cybermandanger at gmail dot com
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. 

$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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-08 21:14 UTC]
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.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 06:01:31 2024 UTC