iLeichun

当前位置: 首页 > JavaScript

JS显示时间日期与星期

分类:JavaScript   来源:网络   时间:2010-08-16 00:06:02

<script language=javascript> 
  today=new Date(); 
  function date(){ 
  this.length=date.arguments.length 
  for(var i=0;i<this.length;i++) 
  this[i+1]=date.arguments } 
  var d=new date("星期日","星期一","星期二","星期三","星期四","星期五","星期六"; 
  document.write( 
  "<font color=##000000 style=’font-size:9pt;font-family: 宋体’> ", 
  today.getYear(),"年",today.getMonth()+1,"月",today.getDate(),"日", 
  d[today.getDay()+1],"</font>" ); 
</script> 

更多