ID:               41386
 Updated by:       [EMAIL PROTECTED]
 Reported By:      andy at needcheats dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Date/time related
 Operating System: WinXP SP2
 PHP Version:      5.2.2
 New Comment:

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...


Previous Comments:
------------------------------------------------------------------------

[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 http://bugs.php.net/?id=41386&edit=1

Reply via email to