<scripttype="text/javascript"> <!-- var curtime =Math.round(newDate().getTime()/1000); var tartime =Math.round(Date.parse(newDate(2011,10,10))/1000);
setInterval( function(){ var sec = tartime-curtime; var day =parseInt(sec/(3600*24)); var hours =parseInt(sec%(3600*24)/3600); var minute =parseInt(sec%(3600*24)%3600/60); var second =parseInt(sec%(3600*24)%3600%60); document.getElementById("showtime").innerHTML="離2011年10月10日還有:"+ day +"天"+ hours +"時"+ minute +"分"+ second +"秒";
curtime++; } ,1000); --> </script> <div id="curtime"></div> <div id="showtime"></div>