var weeks=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]; var today = new Date(); var num = today.getDay();//0-6 0:星期日 1:星期一 console.log("今天:" + weeks[num]);
效果: