var enabled = 0; today = new Date(); var day; var date; if(today.getDay()==0) day = "星期日" if(today.getDay()==" />
东方星雨

简单网络

一个爱好网络的80后男站长。

关注我东方星雨个人微信号:476847113

您现在的位置是:首页 > 站长日志

JS显示当前日期

2010-04-19 站长 站长日志


日期
<script language="JavaScript" class="unnamed1">
var enabled = 0;
today = new Date();
var day;
var date;
if(today.getDay()==0) day = "星期日"
if(today.getDay()==1) day = "星期一"
if(today.getDay()==2) day = "星期二"
if(today.getDay()==3) day = "星期三"
if(today.getDay()==4) day = "星期四"
if(today.getDay()==5) day = "星期五"
if(today.getDay()==6) day = "星期六"
date=(today.getYear())+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日";
document.write("<span style="font-size:12px;" >");
document.write(date);
document.write("&nbsp;");
document.write(day);
document.write("</span>");
</script>

文章评论