I am working with unix timestamps in a database. I have two times; One of them is stored when the user first logs in, the other is stored one they complete their training.
I have a reporting feature that records the total time (in hours) that the person took to complete the training. I am having a difficult time calculating the end result. (Its possible that the person can finish in less than an hour).
It should also round up to the nearest 15 minute interval. The calculation I am using now is:
<?php
$time_diff = $time_complete - $login_time;
$time_diff = round(round((($time_diff/60)/60),PHP_ROUND_HALF_ODD),2);
?>
The current functionality doesn't have the ability to round to the nearest 15 minute interval, and its showing people under an hour as like 0.26 for example.