var data = new Date()
var days = parseInt(data / 1000 / 60 / 60 / 24, 10);
var hours = parseInt(data / 1000 / 60 / 60 % 24, 10)
var minutes = parseInt(data / 1000 / 60 % 60, 10)
var seconds = parseInt(data / 1000 % 60, 10)
var str = (days ? days + "天" : "") + (hours ? hours + "时" : "") + (minutes ? minutes + "分" : "") + (seconds ? seconds + "秒" : "")
关于js倒计时的一种写法
最新推荐文章于 2024-10-06 12:17:25 发布