Hi I am getting an error with the date() function in php 4.3.9 which is not there in php 4.3.2. Below is the code, followed by the output.
Any help will be appreciated.
Thanks.
Zawar
/ Code /
while ($ua->dateDiffDays($cellDate, $shopBO->theDate[1]) > 0)
{
array_push($arrAttns, $newA);
$cellDate = $ua->dateToStamp($cellDate);
$cellDateStp = $ua->addDaysToDate($cellDate, 1);
$cellDate = $ua->stampToDate($cellDateStp);
echo ($cellDateStp." ".$cellDate."<br>");
}
function addDaysToDate($date, $days)
{
$daySecs = $days 24 60 * 60;
$date += $daySecs;
return $date;
}
function dateToStamp($date)
{
$dateArr = explode ("-",$date);
$dateStp = mktime (0,0,0,
$dateArr[1], $dateArr[0], $dateArr[2]);
return $dateStp;
}
function stampToDate($dateStamp)
{
return date ("d-n-Y", $dateStamp);
}
/ gives the following output /
/
1096689600 02-10-2004
1096776000 03-10-2004
1096862400 04-10-2004
1096948800 05-10-2004
1097035200 06-10-2004
1097121600 07-10-2004
1097208000 08-10-2004
1097294400 09-10-2004
1097380800 10-10-2004
1097467200 11-10-2004
1097553600 12-10-2004
1097640000 13-10-2004
1097726400 14-10-2004
1097812800 15-10-2004
1097899200 16-10-2004
1097985600 17-10-2004
1098072000 18-10-2004
1098158400 19-10-2004
1098244800 20-10-2004
1098331200 21-10-2004
1098417600 22-10-2004
1098504000 23-10-2004
1098590400 24-10-2004
1098676800 25-10-2004
1098763200 26-10-2004
1098849600 27-10-2004
1098936000 28-10-2004
1099022400 29-10-2004
1099108800 30-10-2004
1099195200 31-10-2004
1099281600 31-10-2004
1099281600 31-10-2004
1099281600 31-10-2004
1099281600 31-10-2004
1099281600 31-10-2004
1099281600 31-10-2004
1099281600 31-10-2004
1099281600 31-10-2004
.... i.e. the same line gets repeated
/