Javascript 日期 加减

//create the date
var myDate = new Date();

//add a day to the date
myDate.setDate(myDate.getDate() + 1);

//add a week
myDate.setDate(myDate.getDate() + 7);

//add a month
myDate.setMonth(myDate.getMonth() + 1);

//add a year
myDate.setYear(myDate.getYear() + 1);

原文地址:https://www.cnblogs.com/cb168/p/4244200.html