如果想输出指定的日期,那么把Date 传入 Date.parse()构造方法里
var box = new Date(Date.parse(‘6/13/2011′));//Mon Jun 132011 00:00:00 GMT+0800
得到星期几:
var d=new Date()
var weekday=new Array(7)
weekday[0]="星期日"
weekday[1]="星期一"
weekday[2]="星期二"
weekday[3]="星期三"
weekday[4]="星期四"
weekday[5]="星期五"
weekday[6]="星期六"
document.write("今天是" + weekday[d.getDay()])