var weekday = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
var day1=new Date();
document.write(
day1.getFullYear() + "年" + (day1.getMonth()+1) + "月" + day1.getDate()+ "日" + " "+ weekday[day1.getDay()]
);
var weekday = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
最后的分号用成了中文的分号,要用英文的分号。写代码时要注意在半角状态下写,就是英文状态下。