Question: how to calculate the difference between two times in php?
Answer: <? php function differenceInHours($startdate,$enddate){ $starttimestamp = strtotime($startdate); $endtimestamp = strtotime($enddate); $difference = abs($endtimestamp - $starttimestamp)/3600; return $difference; } if(!