<div class="codetitle"> <span><a style="CURSOR: pointer" data="64419" class="copybut" id="copybut64419" onclick="doCopy('code64419')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code64419"> <br> <br> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <br><script type="text/javascript"> <BR>function bodyLoad(){ <BR>var dateTime=new Date(); <BR>var hh=dateTime.getHours(); <BR>if(hh<10) hh = '0' + hh; <BR>var mm=dateTime.getMinutes(); <BR>if(mm<10) mm = '0' + mm; <BR>var ss=dateTime.getSeconds(); <BR>if(ss<10) ss = '0' + ss; <BR>var yy=dateTime.getFullYear(); <br><br>var MM=dateTime.getMonth()+1; //因为1月这个方法返回为0,所以加1 <BR>var dd=dateTime.getDate(); <BR>var week=dateTime.getDay(); <BR>var days=[ "日 ", "一 ", "二 ", "三 ", "四 ", "五 ", "六 ",] <BR>document.getElementById("date").value=yy+"年"+MM+"月"+dd+"日 "+"星期"+days[week] ; <BR>document.getElementById("time").value=hh+":"+mm+":"+ss; <BR>setTimeout(bodyLoad,1000); <BR>} <BR></script> <br> <br> <br><input type="text" id="date" style="border:0 none;"><input type="text" id="time" style="border:0 none;"> <br> <br> <br> </div>