<div class="codetitle"> <span><a style="CURSOR: pointer" data="72510" class="copybut" id="copybut72510" onclick="doCopy('code72510')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code72510"> <br><br> <br> <br> <br> <script type="text/javascript"><BR> function bodyLoad(){<br><br> var dateTime=new Date();<BR> var hh=dateTime.getHours();//小时<BR> var mm=dateTime.getMinutes();//分钟<BR> var ss=dateTime.getSeconds();//秒钟<br><br> var yy=dateTime.getFullYear();//年份<BR> var MM=dateTime.getMonth()+1; //月份-因为1月这个方法返回为0,所以加1<BR> var dd=dateTime.getDate();//日数<br><br> var week=dateTime.getDay();//周(0~6,0表示星期日)<BR> var days=[ "日 ", "一 ", "二 ", "三 ", "四 ", "五 ", "六 ",]<br><br> document.getElementById("date").innerHTML=yy+"年"+MM+"月"+dd+"日 "+"星期"+days[week] ;<BR> document.getElementById("time").innerHTML=hh+"时"+mm+"分"+ss+"秒";<br><br> setTimeout(bodyLoad,1000);<BR> }<BR> </script><br> <br> <br> <span id="date"></span><br> <span id="time"></span><br> <br> <br> </div>