HH: MM Format Time Writing
private function formatTime(t:int):String
{
var s:int = Math.round(t);
var m:int = 0;
if (s > 0)
{
while (s > 59) {
m++;
s -= 60;
}
return String((m < 10 ? "0" : "") + m + ":" + (s < 10 ? "0" : "") + s);
}
else
{
return "00:00";
}
}
Written by Yasin Burak Kalkan
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Time
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#