var date = new Date(); var year = date.getFullYear(); var month = date.getMonth()+1; var day = date.getDate(); var week = date.getDay(); console.log("今天是:"+year+"-"+month+"-"+day+"-周"+week); // 今天是:2016-2-24-周3 console.log(date.toLocaleString()); // 2016/2/24 下午4:23:27