//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);
JS的Date日期增加天,月,年,星期
最新推荐文章于 2024-09-03 15:44:40 发布