JS设置时间为6天后

Posted JackAfan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JS设置时间为6天后相关的知识,希望对你有一定的参考价值。

Date对象

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

 

以上是关于JS设置时间为6天后的主要内容,如果未能解决你的问题,请参考以下文章