我正在使用一个返回这样的时间的 API,deal_expiration_time:1469396377
它看起来像从 1970 年开始的秒数。我试图在 MM/SS 中进行倒计时这是有角度的,所以我显然不能使用 jQuery?我已经挣扎了一段时间,对这段代码感到困惑。我正在努力做到这一点input: 1469396377 | output: 08:21
function(){
var x1, secs1 = 510;
x1 = setInterval(function(){myFunc1(9)}, 1000);
function myFunc1(timerId){
var minutes = Math.floor(secs1 / 60);
var seconds = secs1 % 60;
$('#timer_'+timerId).html(minutes + ':' + seconds); //assuming there is a label with Id 'timer'
secs1--;
if(secs1 == 0){
document.getElementById('timer_' + timerId).style.hidden = true;
clearInterval(x1);
}
}
}