/ Published in: ActionScript 3
Easily convert seconds into a hh:mm:ss format.
Expand |
Embed | Plain Text
private function formatTime (input:int):String { var hrs:String = (input > 3600 ? Math.floor(input / 3600) + ':' : ''); var mins:String = (hrs && input % 3600 < 600 ? '0' : '') + Math.floor(input % 3600 / 60) + ':'; var secs:String = (input % 60 < 10 ? '0' : '') + input % 60; return hrs + mins + secs; }
You need to login to post a comment.
