I calculate the time difference of the night shift schedule only using time
lets say that I have this data:
$actual_in_time = 6:45 PM //date July 30, 2013 $actual_out_timeout = 7:00 AM //date July 31, 2013
I need to calculate the time difference in which time in should be converted all the time, therefore
$actual_in_time = //(some code to convert 6:45 PM to 7:00 PM) $converted_in_time = $actual_in_time;
Now here is my code:
$actual_out_time += 86400; $getInterval = $actual_out_time - $converted_in_time; $hours = round($getInterval/60/60, 2, PHP_ROUND_HALF_DOWN); $hours = floor($hours);
I do not get the desired results. How do you calculate the time difference when only time is the basis?
source share