倒计时
function good(n){
var toDate = new Date(n*1000);
var toTime = Math.floor(toDate.getTime()/1000);
toTimer();
setInterval(toTimer,1000);
function toTimer()
{
var nowDate = new Date();
var nowTime = Math.floor(nowDate.getTime()/1000);
var day = Math.floor((toTime-nowTime)/86400);
var hour = Math.floor((toTime-nowTime)%86400/3600);
var minute = Math.floor((toTime-nowTime)%86400%3600/60);
var second = Math.floor((toTime-nowTime)%86400%3600%60);
console.log(day+'天'+p(hour)+':'+p(minute)+':'+p(second)+'后开始');
}
function p(s) {
return s < 10 ? '0' + s: s;
}
}
good(结束时间戳)