Skip to content

Instantly share code, notes, and snippets.

@stefanocudini
Created July 30, 2012 21:52
Show Gist options
  • Select an option

  • Save stefanocudini/3210647 to your computer and use it in GitHub Desktop.

Select an option

Save stefanocudini/3210647 to your computer and use it in GitHub Desktop.
seconds to h:m:s
<?
function format_time($t,$f=':') // t = seconds, f = separator
{
return sprintf("%02d%s%02d%s%02d", floor($t/3600), $f, ($t/60)%60, $f, $t%60);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment