Please, i need to get the time difference between a particular time and the current time. ie. I want to track users who submit an assignment late. the deadline time is 10:00AM everyday.I have surf,but all the solution i am seeing does not seems to work. see below:
<?php
$d1 = new DateTime(date('Y-m-d 10:00:00'));//Deadline time
$d2 = new DateTime(date('Y-m-d H:i:s'));//Submission time
$interval = $d1->diff($d2);
$c = $interval->minute;
if($c>0){
echo "submitted late";}else{ echo "Submitted on time";}
?>