format(ts) {
var r = '';
var s = parseInt(ts);// 秒
var m = 0;// 分
var h = 0;// 时
if (s > 60) {
m = parseInt(s / 60);
s = parseInt(s % 60);
if (m > 60) {
h = parseInt(m / 60);
m = parseInt(m % 60);
}
}
if (s >= 0 && s < 10) {
r = "0" + parseInt(s) + "\"";
} else {
r = "" + parseInt(s) + "\"";
}
if (m >= 0 && m < 10) {
r = "0" + parseInt(m) + "':" + r;
} else {
r = "" + parseInt(m) + "':" + r;
}
if (h >= 0 && h < 10) {
r = "0" + parseInt(h) + ":" + r;
} else {
r = "" + parseInt(h) + ":" + r;
}
return r;
},
秒 转成 格式为 00:00‘:00‘‘
最新推荐文章于 2023-06-18 02:58:28 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)