On Tue, 31 Aug 2004 09:53:01 +1200, in php.general [EMAIL PROTECTED] (John Clegg) wrote:
>I have been using mktime() to determine the next 12 months for a >program, and i have discovered what seems a bug in the function. > >The following code... > ><?php >for($i=0;$i < 12;$i++){ > >$currentDate = date("d m Y",mktime(0, 0, 0,date("m")+$i , date("d"), >date("Y"))); There is no bug. Currently it is the 31. august. For $i ==1, you are setting the date to 31. september => 1. october. For $i ==2, you are setting the date to 31. october For $i ==3, you are setting the date to 31. november => 1. december For $i ==4, you are setting the date to 31. december .. and so on. Since you only look at the month, you would get october, october, december, december, etc. -- - Peter Brodersen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php