Converting second to readable time
This code is applied from http://www.ultramegatech.com/blog/2009/06/snippet-converting-seconds-to-readable-time/
Copy this code and paste it in your HTML
function formatTime($secs) {
$time = '';
foreach (array(3600, 60, 1) as $i => $sec) { $time .= sprintf('%02d', floor($secs / $sec)).($i < 2 ?
':' : ''); $secs = $secs % $sec;
}
return $time;
}
Report this snippet
Comments
Subscribe to comments