|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-06-19 10:52 UTC] derick@php.net
-Status: Open
+Status: Not a bug
[2012-06-19 10:52 UTC] derick@php.net
[2012-06-19 10:59 UTC] praflo at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
Description: ------------ In the mktime() function if you add a "0" before the number of the month of August or September (eg. august -> 08) the result is something wrong. See example below. It seems this happens only with "08" and "09", not with "07", "06", etc. I discovered this because August 12th 2012 (08-12-2012) is the last day of the next Olympic games in London. Hope this helps bye gian (PHP version: PHP 5.3.8-pl0-gentoo) Test script: --------------- <?php $timestamp1 = mktime(23,59,59,08,12,2012); $timestamp2 = mktime(23,59,59, 8,12,2012); $out1 = date("m-d-Y H:i:s",$timestamp1); $out2 = date("m-d-Y H:i:s",$timestamp2); echo "DATE1 is : $out1\n"; echo "DATE2 is : $out2\n"; /* output is: DATE1 is : 12-12-2011 23:59:59 <---- IT SAYS DEC 12 2011 !!! DATE2 is : 08-12-2012 23:59:59 */ ?> Expected result: ---------------- DATE1 is : 08-12-2012 23:59:59 DATE2 is : 08-12-2012 23:59:59 Actual result: -------------- DATE1 is : 12-12-2011 23:59:59 DATE2 is : 08-12-2012 23:59:59