此时此刻对于2014年10月1日0时0分0秒过去了<span id=nowtime></span>
<script>
function getTheTime(){
var t=new Date() - new Date(2014,9,1);
var d=Math.floor(t/1000/60/60/24);
t-=d*1000*60*60*24;
var h=Math.floor(t/1000/60/60);
t-=h*1000*60*60;
var m=Math.floor(t/1000/60);
t-=m*1000*60;
var s=Math.floor(t/1000);
return d+"天"+h+"小时"+m+"分钟"+s+"秒";
}
window.onload=function(){
setInterval("nowtime.innerHTML=getTheTime();",1000);
}
</script>
温馨提示:答案为网友推荐,仅供参考