Bug #25050 [Bgs]: mktime(); and gmmktime(); using "xx" parameter
| From: | pajoye@php.net | Date: | Sat, 03 Apr 2010 13:03:02 +0000 |
| Subject: | Bug #25050 [Bgs]: mktime(); and gmmktime(); using "xx" parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-149305@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=25050&edit=1
ID: 25050
Updated by: pajoye@php.net
Reported by: tlii_php at bsb dot cz
Summary: mktime(); and gmmktime(); using "xx" parameter
Status: Bogus
Type: Bug
Package: Date/time related
Operating System: Linux
PHP Version: 4.3.2
New Comment:
bugs.php.net is not a support channel, read
http://en.wikipedia.org/wiki/Octal_number if
you need more details about
octal numbers.
Previous Comments:
------------------------------------------------------------------------
[2010-04-03 14:37:22] enabled at yandex dot ru
Then why vardump(4==04) is true?
------------------------------------------------------------------------
[2003-08-12 04:32:35] derick@php.net
08 does not exist, because the octal number 8 doesn't exist. If you
prefix a number with a 0 it marks the number as octal, and because in
some cases a number doesnt exist you get weird output. This is not a bug
-> bogus.
------------------------------------------------------------------------
[2003-08-12 04:23:00] tlii_php at bsb dot cz
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 this bug report at http://bugs.php.net/bug.php?id=25050&edit=1