获取下个星期0点的毫秒数

/**
* 获取下个星期0点的毫秒数
* week 下个星期几 int
*/
var getnextWeek = function(week) {
var today = new Date();
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
today.setMilliseconds(0);
var oneday = 1000 * 60 * 60 * 24;
var nextMonday = today- oneday * ((today.getDay()-1) - 7 - (week-1));
return nextMonday
}

发布了2 篇原创文章 · 获赞 0 · 访问量 1288

猜你喜欢

转载自blog.csdn.net/woages/article/details/105730792