Edit report at https://bugs.php.net/bug.php?id=41386&edit=1
ID: 41386 Comment by: kai dot business at childheart dot info Reported by: andy at needcheats dot com Summary: Month order output wrong Status: Not a bug Type: Bug Package: Date/time related Operating System: WinXP SP2 PHP Version: 5.2.2 Block user comment: N Private report: N New Comment: They say that this isn't a bug, but it'd be far easier to code if the months started off normally. I have to code January as 2 just to make it line up correctly which is nonsense. Previous Comments: ------------------------------------------------------------------------ [2007-05-13 19:58:10] der...@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Day \"0\" is the last day of the previous month... ------------------------------------------------------------------------ [2007-05-13 19:39:09] andy at needcheats dot com Description: ------------ I am getting an incorrect output of a list of months. Starts with December instead of January! **NOT** having same problem with Days and Years using the same loop method! Reproduce code: --------------- $now = date('n'); for($i = 1; $i <= 12; $i++) { $month = date("F", mktime(0, 0, 0, $i, 0, 0)); $value = date("m", mktime(0, 0, 0, $i, 0, 0)); echo $i.'-'.$value.'-'.$month.'<br/>'; } Expected result: ---------------- The loop should output the following: 1-01-January 2-02-February 3-03-March 4-04-April 5-05-May 6-06-June 7-07-July 8-08-August 9-09-September 10-10-October 11-11-November 12-12-December Actual result: -------------- Following unexpected result is produced: 1-12-December 2-01-January 3-02-February 4-03-March 5-04-April 6-05-May 7-06-June 8-07-July 9-08-August 10-09-September 11-10-October 12-11-November ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=41386&edit=1