Posted at

ミリ秒を時分秒へ変換

More than 5 years have passed since last update.


computeDuration


/**
* ミリ秒を時分秒へ変換
* ms ミリ秒
*/

function computeDuration(ms){
var h = String(Math.floor(ms / 3600000) + 100).substring(1);
var m = String(Math.floor((ms - h * 3600000)/60000)+ 100).substring(1);
var s = String(Math.round((ms - h * 3600000 - m * 60000)/1000)+ 100).substring(1);
return h+':'+m+':'+s;
}