PHP BUG!
Posted: Tue Aug 31, 2010 7:44 am
hello evrybody !
i have a probleme with mktime() and i think it is a bug, it do it only with the month Oct here is my very simple code:
//it trace :
// $prevM=Jul // ok
//$nextM=Oct // not ok!
BUT IF I PUT THE MONTH TO 9 :
//it trace :
$prevM=Aug // ok
$nextM=Oct // ok!
AND:
trace $prevM=Oct //not ok
$nextM=Dec // ok!
the thing i dont follow is that it was working before !
i have a probleme with mktime() and i think it is a bug, it do it only with the month Oct here is my very simple code:
Code: Select all
<?php
$themonth=8;
$prevM = date("M", mktime(0, 0, 0, ($themonth - 1) ));
$nextM = date("M", mktime(0, 0, 0, ($themonth + 1) ));
echo '$prevM='.$prevM.'<br />$nextM='.$nextM;
?>// $prevM=Jul // ok
//$nextM=Oct // not ok!
BUT IF I PUT THE MONTH TO 9 :
Code: Select all
themonth=9;
$prevM = date("M", mktime(0, 0, 0, ($themonth - 1) ));
$nextM = date("M", mktime(0, 0, 0, ($themonth + 1) ));
echo '$prevM='.$prevM.'<br />$nextM='.$nextM;$prevM=Aug // ok
$nextM=Oct // ok!
AND:
Code: Select all
themonth=10;
$prevM = date("M", mktime(0, 0, 0, ($themonth - 1) ));
$nextM = date("M", mktime(0, 0, 0, ($themonth + 1) ));
echo '$prevM='.$prevM.'<br />$nextM='.$nextM;trace $prevM=Oct //not ok
$nextM=Dec // ok!
the thing i dont follow is that it was working before !