javascript 当前日期加(天、周、月、年)
作者:bea
代码如下: //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 ye
代码如下:
//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);
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- jQuery 判断页面元素是否存在的代码
- JavaScript写的一个DIV 弹出网页对话框
- 使用JQuery和s3captche实现一个水果名字的验证
- JS 添加删除元素的实现代码
- javascript 不停(setInterval)/延时(setTimeout)函数使用实例
- img标签中onerror用法
- 什么是JavaScript
- Javascript Global对象
- Javascript Math对象
- Javascript 作用域使用说明
- Javascript 继承机制实例
- Javascript 继承机制的实现
- Javascript 继承实现例子
- 一些不错的JS 自定义函数
- JavaScript 十六进制RGB色码转换器
- JQuery jsonp 使用示例代码
- Javascript array类 数组操作方法
- 上传图片时JS自动显示图片
- Javascript+XMLHttpRequest+asp.net无刷新读取数据库数据