Created
June 18, 2015 12:27
-
-
Save zerolab/b25766c50f834d45b4fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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