Am trying to create a simple program that will compute for an employees time in and time out. I just want to know how to compute for the difference of a time in and time out, even if an employee time in 8.00am jan 7 and time out jan 9 8.00am. we get that a lot from here. i just want to compute the time difference or the total time consumed within a time in and time out...
I tried this:
$sec = mktime(10,0,0,1,9,2004) - mktime(8,0,0,1,9,2004);
echo date('H:i:s', $sec); // will echo 18:00:00
How can i convert this into real time? as in total hours and minutes like, i want the above example to produce "2:00".
how can i do this?
I tried this:
$sec = mktime(10,0,0,1,9,2004) - mktime(8,0,0,1,9,2004);
echo date('H:i:s', $sec); // will echo 18:00:00
How can i convert this into real time? as in total hours and minutes like, i want the above example to produce "2:00".
how can i do this?