The following function will help you get the difference from two dates in PHP. You need to specify the 2 dates when you call the function in PHP.

function dateDifffun($date1, $date2){
    	$datetime1 = new DateTime($date1);
  $datetime2 = new DateTime($date2);
  $interval = $datetime1->diff($datetime2);
  return $interval->format('%H:%I');
}

 

You might find interesting:   Show A List Of Days Between Two Dates in PHP

NO COMMENTS

LEAVE A REPLY