标签:second hmm ons bsp 时间戳 mss time log 需要
只需要 toHHmmss(时间戳)即可
function toHHmmss (data) {
var time;
var hours = parseInt((data % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = parseInt((data % (1000 * 60 * 60)) / (1000 * 60));
var seconds = (data % (1000 * 60)) / 1000;
time = (hours < 10 ? (‘0‘ + hours) : hours) + ‘:‘ + (minutes < 10 ? (‘0‘ + minutes) : minutes) + ‘:‘ + (seconds < 10 ? (‘0‘ + seconds) : seconds);
return time;
console.log(time)
}
标签:second hmm ons bsp 时间戳 mss time log 需要
原文地址:https://www.cnblogs.com/xxshen/p/14251507.html