时间代码,兼容性好
2013-08-15 00:04:46   来源:   浏览: 次

导读:<script language="JavaScript" type="text javascript"> var today=new Date();var strDate=(" "+today getYear()+"年"+(today getM
<script language="JavaScript" type="text/javascript">
var today=new Date();var strDate=(" "+today.getYear()+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日");var n_day=today.getDay();switch(n_day)
{case 0:
{strDate=strDate+"  星期日 "
}break;case 1:
{strDate=strDate+"  星期一 "
}break;case 2:
{strDate=strDate+"  星期二 "
}break;case 3:
{strDate=strDate+"  星期三 "
}break;case 4:
{strDate=strDate+"  星期四 "
}break;case 5:
{strDate=strDate+"  星期五 "
}break;case 6:
{strDate=strDate+"  星期六 "
}break;case 7:
{strDate=strDate+"  星期日 "
}break;}document.write("<font color=#ffffff>"+strDate+"<font>");</script>