Difference between two dates in days, hours & minutes
$openDate = strtotime($record['createdDate']);
$closeDate = strtotime($record['closedDate']);
$dateDiff = ($closeDate - $openDate);
$d = ($dateDiff/(60*60*24))%365;
$h = ($dateDiff/(60*60))%24;
$m = ($dateDiff/60)%60;
echo $d." days\n";
echo $h." hours\n";
echo $m." minutes\n";
Note: I had to change $RECORD to $record to get it to work with my local WAMP server.
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.