日期:2014-05-16  浏览次数:20413 次

js显示时间 (2010年1月9日 星期六 16:43 )

<SCRIPT language=JavaScript>
<!---
today=new Date();
var hours = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
if(hours<10)
?? hours="0"+hours;
if(minutes<10)
minutes="0"+minutes;
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("星期<span color=’red’>日</span>","星期<span color=’red’>一</span>","星期<span color=’red’>二</span>","星期<span color=’red’>三</span>","星期<span color=’red’>四</span>","星期<span color=’red’>五</span>","星期<span color=’red’>六</span>");
document.write("<span style=’color:red;font-weight:500;font-size:14px;’>",today.getYear(),"</span>年<span style=’color:red;font-weight:500;font-size:14px;’>",today.getMonth()+1,"</span>月<span style=’color:red;font-weight:500;font-size:14px;’>",today.getDate(),"</span>日??? ",d[today.getDay()+1],"?????????? <font style='font-size:14px;font-weight:500;' >",hours,"<span style='color:red;font-weight:700;'>:</span>",minutes,"</font>????????? ");
//-->
</SCRIPT>
<script></script>