var mymonth=mydate.getMonth()+1;
为什么算月份的时候后面要+1啊?
var mydate= new Date();
var myyear=mydate.getFullYear();
var mymonth=mydate.getMonth()+1;
var mynum=mydate.getDay();
var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六",]
document.write(mydate+"<br>");
document.write(myyear+"<br>");
document.write(mymonth+"<br>");
document.write(myyear+"年"+mymonth+"月"+mynum+"日"+weekday[mynum]+"<br>");
我这么输出的日期怎么不对呢?