function padTo2Digits(num) {
return num.toString().padStart(2, '0');
}
function convertMsToHM(milliseconds) {
let seconds = Math.floor(milliseconds / 1000);
let minutes = Math.floor(seconds / 60);
let hours = Math.floor(minutes / 60);
seconds = seconds % 60;
minutes = seconds >= 30 ? minutes + 1 : minutes;
minutes = minutes % 60;
hours = hours % 24;
return `${padTo2Digits(hours)}:${padTo2Digits(minutes)}`;
}
console.log(convertMsToHM(54000000));
console.log(convertMsToHM(86400000));
console.log(convertMsToHM(36900000));
console.log(convertMsToHM(15335000));
console.log(convertMsToHM(130531000));