求问,new Date里面没有设置日期,那么后面得到的年月份是怎么出来的呢?是随机出的?
var mydate=new Date();
var weekday=["星期一","星期二","星期三","星期四","星期五"]//通过javascript的日期对象来得到当前的日期,并输出。document.write(mydate.getFullYear()+"年"+mydate.getMonth()+"月"+mydate.getDay()+"日"+weekday[mydate.getDay()]);