Hi
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)));
$currentDateArray = explode(
On Tuesday 31 August 2004 05:53, 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 ,
gives the following output:
$i : Month: Year
0 : 08 : 2004
1 : 10 : 2004
2 : 10 : 2004
3 : 12 : 2004
4 : 12 : 2004
5 : 01 : 2005
6 : 03 : 2005
7 : 03 : 2005
8 : 05 : 2005
9 : 05 : 2005
10 : 07 : 2005
11 : 07 : 2005
Your bug is being caused by short months. If you ask mktime() to give
you the
3 matches
Mail list logo