- substr: documentation ( source)
- var_dump: documentation ( source)
- strpos: documentation ( source)
- round: documentation ( source)
- gmdate: documentation ( source)
- number_format: documentation ( source)
<?php
$time = 937.008;
$time = round($time, 2);
var_dump($time);
var_dump(gmdate('H:i:s', $time) . substr($time, strpos($time, '.')));
var_dump($time);
$timeOut = '';
if ($time > 60 * 60) {
$timeOut .= gmdate('H', $time) . ' hours, ';
}
if ($time > 60) {
$timeOut .= gmdate('i', $time) . ' min, ';
}
$timeOut .= number_format(($time % 60), 2) . ' sec';
echo ' (' . $timeOut . ' sec)' . "\n\n";