js 显示时间
<div class="date"> <script language="JavaScript"> today=new Date(); function initArray(){ this.length=initArray.arguments.length for(var i=0;i<this.length;i++) this[i+1]=initArray.arguments[i]} var d=new initArray( "周日","周一","周二","周三","周四","周五","周六"); if(document.all){ if(10>today.getMinutes()){ document.write(today.getYear()+"-"+(today.getMonth()+1)+"-"+today.getDate()+"& "+today.getHours()+":0"+ today.getMinutes()+" "+d[today.getDay()+1]); }else{ document.write(today.getYear()+"-"+(today.getMonth()+1)+"-"+today.getDate()+" "+today.getHours()+":"+ today.getMinutes()+" "+d[today.getDay()+1]); } }else{ if(10>today.getMinutes()){ document.write((today.getYear()+1900)+"-"+(today.getMonth()+1)+"-"+today.getDate()+" "+today.getHours()+":0"+ today.getMinutes()+" "+d[today.getDay()+1]); }else{ document.write((today.getYear()+1900)+"-"+(today.getMonth()+1)+"-"+today.getDate()+" "+today.getHours()+":"+ today.getMinutes()+" "+d[today.getDay()+1]); } } </script> </div>