function formatSeconds(time) {
const hours = Math.floor(time / 3600);
const minutes = Math.floor((time % 3600) / 60);
const seconds = time % 60;
if (hours < 10) {
return `0${hours}:0${minutes}:0${seconds}`;
} else {
return `${hours}:${minutes}:${seconds}`;
}
}
标签:60,const,seconds,minutes,js,hours,time,转为,时分秒
From: https://www.cnblogs.com/DL-CODER/p/17403804.html