php function DocTime time floor time 3600 floor time 3600 60 time 3600

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?php
function DocTime($time) {
$h = floor($time/3600);
$m = floor(($time%3600)/60);
$s = ($time%3600)%60;
return $h.':'.$m.':'.$s;
}
$sum = (time()-1405010920);
echo DocTime($sum);