当前位置: 移动技术网 > IT编程>开发语言>JavaScript > javascript 当前日期加(天、周、月、年)

javascript 当前日期加(天、周、月、年)

2019年07月30日  | 移动技术网IT编程  | 我要评论
复制代码 代码如下://create the date var mydate = new date(); //add a day to the date mydate.se
复制代码 代码如下:

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

如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网