I have this code that should be changing the day of the output, but I’m not getting any change. Can anyone see what is wrong?
<?php
$tempStartDate = "2011-07-04 15:00:00";
$TempDaysFromEvent = "-14";
$newtempStartDate = explode(" ", $tempStartDate);
echo "New Temp Start Date: ".$newtempStartDate[0];
echo "<br>";
list($year, $month, $day) = explode("-", $newtempStartDate[0]);
echo $year." ". $month. " ". $day;
echo "<br>";
$tempStartDate = $tempEndDate = date("Y-m-d", mktime(0,0,0,$month,($day+$tempDaysFromEvent),$year));
echo "TempStart Date:".$tempStartDate."<br>";
?>
This is giving me this output:
New Temp Start Date: 2011-07-04
2011 07 04
TempStart Date:2011-07-04
But I would expect it to give me:
New Temp Start Date: 2011-07-04
2011 07 04
TempStart Date:2011-06-20
you have a capital when you define
$TempDaysFromEventso change it to this