I have a time-average total, which is calculated from the time converted from an integer.
average = 0:0:20
I wanted to change my output as follows:
average = 00:00:20
By the way, this is the code I used to get the average time:
$ans = $times / $displaycount;
$hh = floor($ans / 3600);
$mm = floor(($ans - ($hours*3600)) / 60);
$ss = floor($ans % 60);
$timeavg = $hh.':'.$mm.':'.$ss;
echo "average = ". $timeavg;
source
share