How to convert time milliseconds to hours, min, sec format in JavaScript?
I have the time as milliseconds, but I want the time after conversion like 00:00:00 . Ex: In milliseconds=86400000. I want how many hours in that milliseconds like, 00:00:00 How to get it in JavaScript? Dusht How about doing this by creating a function in javascript as shown below: function msToTime(duration) { var milliseconds = parseInt((duration % 1000) / 100), seconds = Math.floor((duration / 1000) % 60), minutes = Math.floor((duration / (1000 * 60)) % 60), hours = Math.floor((duration / (1000 * 60 * 60)) % 24); hours = (hours < 10) ? "0" + hours : hours; minutes = (minutes < 10) ? "0" +