[ad_1]
Been looking around a bit, but could only find things converting partially, and not into all 3 times.
I got a number from my sql database, and I want to convert it to hh:mm:ss, but I keep getting mm and ss as the same number.
this is my javascript function so far
function time_convert(num){
const hours = Math.floor(num / 60);
const minutes = Math.round(num % 60);
const seconds = Math.round(minutes % 60);
return hours + "t " + minutes + "' " + seconds + '"';
}
Probably is a very simple solution but I can’t for the life of me figure it out right now, any help is appreciated !
[ad_2]