还是啥

  • 坚实的比较多
    ```
    var date = new Date();
    var time = 7200 - date.getMinutes() * 60 - date.getSeconds();

countTime(time)

function countTime(time) {
var timer = null;
if (time > 0) {

  timer = setInterval(function () {
    var h = Math.floor(time / 3600);
    var m = Math.floor((time / 60)) - h * 60;
    var s = time % 3600 - m * 60;


    time--;
  }, 1000)
} else {
  time = null;
}

}
```

猜你喜欢

转载自www.cnblogs.com/ak-b/p/8993845.html