<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>