function getworkday(date,itervalByDay){
var date=new Date();
var millisceonds =date.getTime();
for(var i=1;i<=itervalByDay;i++){
millisceonds +=24*60*60*1000;
date.setTime(millisceonds);
if(date.getDay()==0||date.getDay()==6) i--;
}
return date;
}
var d=getworkday(new Date(),7); //当前时间,7个工作日
youWant=d.getFullYear() + ‘-‘ + (d.getMonth() + 1) + ‘-‘ + d.getDate() + ‘ ‘ + d.getHours() + ‘:’ + d.getMinutes() + ‘:’ + d.getSeconds(); //格式化
console.log(youWant);
版权声明:本文为qq_30938097原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。