JS设置时间为6天后

Date对象

var oDate = new Date;
console.log("当前时间:" + oDate)
oDate.setDate( oDate.getDate() + 6 );//设置为6天
// oDate.setDate();//设置天时间
// oDate.getDate();//获取天时间
console.log("修改后时间:" + oDate)

猜你喜欢

转载自www.cnblogs.com/Afanadmin/p/12339663.html