milliseconds to hh:mm:ss js code example
Example 1: javascript convert milliseconds to hh mm ss
var result = Math.floor(myDuration/(1000*60*60)) + ":" + Math.floor(myDuration/(1000*60))%60 + ":" + Math.floor(myDuration/1000)%60;
Example 2: how to convert seaconds into hh:mm:ss in javascript
var date = new Date(0);
date.setSeconds(45); // specify value for SECONDS here
var timeString = date.toISOString().substr(11, 8);
console.log(timeString)