I want to convert a duration of time, i.e., number of seconds to colon-separated time string (hh:mm:ss)
I found some useful answers here but they all talk about conv
secToHHMM(number: number) {
debugger;
let hours = Math.floor(number / 3600);
let minutes = Math.floor((number - (hours * 3600)) / 60);
let seconds = number - (hours * 3600) - (minutes * 60);
let H, M, S;
if (hours < 10) H = ("0" + hours);
if (minutes < 10) M = ("0" + minutes);
if (seconds < 10) S = ("0" + seconds);
return (H || hours) + ':' + (M || minutes) + ':' + (S || seconds);
}