Skip to content

Instantly share code, notes, and snippets.

@zerolab
Created June 18, 2015 12:27
Show Gist options
  • Save zerolab/b25766c50f834d45b4fa to your computer and use it in GitHub Desktop.
Save zerolab/b25766c50f834d45b4fa to your computer and use it in GitHub Desktop.
<?php
/**
* Converts milliseconds to H:i:s
*/
function _format_time($milliseconds) {
$seconds = round($milliseconds/1000);
$dtZero = new DateTime("@0");
$dtTime = new DateTime("@$seconds");
return $dtZero->diff($dtTime)->format('%H:%i:%s');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment