I am preparing a small php attendance script which will record the time and date of given user.
I am trying to display a message that if person is LATE after given time php to display a message you are late
$CURRENTTIME = new DateTime($data['current_time']);
$CURRENTTIME = $CURRENTTIME->format('H:i:s');
$OFFICETIME = new DateTime('10:20:00');
$OFFICETIME = $OFFICETIME->format('H:i:s');
var_dump($CURRENTTIME);
var_dump($OFFICETIME);
if ($CURRENTTIM > $OFFICETIME) {
echo 'you are late tody';
} else {
echo 'Thank you for being on time';
}
also i wanted to learn the code if i need a result in between time? let say i need to display result if employee is in between 10:00:00 - 10:30:00