javascript 当前日期加(天、周、月、年)
摘要:复制代码代码如下://createthedatevarmyDate=newDate();//addadaytothedatemyDate.s...
复制代码 代码如下:
//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);
【javascript 当前日期加(天、周、月、年)】相关文章:
★ javascript+HTML5自定义元素播放焦点图动画
★ JavaScript实现DIV层拖动及动态增加新层的方法
★ JavaScript实现点击自动选择TextArea文本的方法