|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-13 19:58 UTC] derick@php.net
[2012-06-04 10:49 UTC] kai dot business at childheart dot info
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 21:00:02 2025 UTC |
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