慕妹6610264
2017-12-10 16:39
var mydate=new Date();
var weekday["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
document.write(mydate.getFullYear()+"年"+mydate.getMonth()+1+"月"+mydate.getDate()+"日"+weekday[mydate.getDay()]);
weekday变量定义时候出错,少了等号。
var today=new Date();
var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
document.write(today.getFullYear()+"年"+today.getMonth()+"月"+today.getDate()+"日 "+weekday[today.getDay()]+"--班级总分为:");
这是我写的,你mydate.getMonth()+1是什么意思呢
等号没加
var mydate=new Date();
var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
document.write(mydate.getFullYear()+"年"+mydate.getMonth()+1+"月"+mydate.getDate()+"日"+weekday[mydate.getDay()+1]);
JavaScript进阶篇
468190 学习 · 21891 问题
相似问题