您好,欢迎来到葵兜健康网。
搜索
您的当前位置:首页javascript当前日期加(天、周、月、年)_时间日期

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);

Copyright © 2019- kduo.cn 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务