参见英文答案 > Use jQuery/JS to determine the DAY OF WEEK 6个
我现在已经是aswer之前,问题是我从输入的日期不是当前日期.
我需要得到一周的一天.目前我得到这种格式的日期:
11/09/2013
但我希望它像:
Saturday/02/2013.
最佳答案
var date = new Date();
var weekdays = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
var weekday = weekdays[date.getDay()];
var month = date.getMonth() + 1;
var year = date.getYear();