could anyone tell me why this code is not producing the expected results? I would expect this code to return a timedifference of 5 days. Instead I get 595! Help!
$currenttime = time();
echo "mktime: $currenttime<BR>"; //produces 990396193
echo "Current time: ". strftime("%Y-%m-%d" ,$currenttime)."<br>"; //produces 2001-05-20
$dbase_date="2001-05-25";
echo "dbase date: $dbase_date<BR>"; //produces 2001-05-25
list($year, $month, $day) = explode("-", $dbase_date);
$newdate=mktime(0, 0, 0, $day, $month, $year);
echo "mktime: $newdate<BR>"; // produces 1041742800
$timedifference =$currenttime-$newdate;
$retval = $timedifference/86400; //86400 seconds in a day
$daysdiff = floor($retval);
echo "days different: $daysdiff<BR>"; //produces -595