function formatTime(time) {
var hours = Math.floor(time / 3600);
var minutes = Math.floor(Math.floor(time % 3600) / 60);
var seconds = Math.floor(time % 60);
var h = hours.toString().length === 1 ? `0${hours}` : hours;
var m = minutes.toString().length === 1 ? `0${minutes}` : minutes;
var s = seconds.toString().length === 1 ? `0${seconds}` : seconds;
return `${h} 小时 ${m} 分钟 ${s} 秒`;
}
08-16
1244
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-18
429
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-27
1110
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-10
08-09
2146
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-31
729
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-11