发布网友 发布时间:2024-10-24 04:27
共1个回答
热心网友 时间:1小时前
<script language="JavaScript">
var today = new Date(); //new Date大写
var day;
var date;
if(today.getDay()==0) day = "星期日" //注意getDay大写
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 = "星期六"
date1 = "今天是"+ (today.getYear())+ "年" + (today.getMonth() + 1 ) + "月" + today.getDate() + "日" ; //today.getDate()处你多了个(或者前面加(后面跟上)如:(today.getDate())及大小写
document.write(date1 +day);
</script>