js判断某一天是星期几

 example:

  
  
  
  
  1. var weekday = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; 
  2. var today = new Date(); 
  3. alert("Today is "+weekday[today.getDay()]); 

month:0~11对应1~12月

返回值:0对应Sunday,1~6对应Monday~Saturday

你可能感兴趣的:(某一天是星期几)