function getMyDay(date){ var week; if(date.getDay()==0) week="星期日" if(date.getDay()==1) week="星期一" if(date.getDay()==2) week="星期二" if(date.getDay()==3) week="星期三" if(date.getDay()==4) week="星期四" if(date.getDay()==5) week="星期五" if(date.getDay()==6) week="星期六" return week; } var weeks = getMyDay(new Date("2017-09-25")); console.log(weeks);
时间: 2024-10-29 09:51:23