js 指定日期加一天
2016-09-22 09:58
176 查看
function dateAdd(startDate) {
startDate = new Date(startDate);
startDate = +startDate + 1000*60*60*24;
startDate = new Date(startDate);
var nextStartDate = startDate.getFullYear()+"-"+(startDate.getMonth()+1)+"-"+startDate.getDate();
return nextStartDate;
}
这里的startDate是我从别的地方传过来的,可以自定义时间, startDate = +startDate + 1000*60*60*24;当时间为月末,这里会自动加一个月。
startDate = new Date(startDate);
startDate = +startDate + 1000*60*60*24;
startDate = new Date(startDate);
var nextStartDate = startDate.getFullYear()+"-"+(startDate.getMonth()+1)+"-"+startDate.getDate();
return nextStartDate;
}
这里的startDate是我从别的地方传过来的,可以自定义时间, startDate = +startDate + 1000*60*60*24;当时间为月末,这里会自动加一个月。
相关文章推荐
- [置顶] js日期处理---计算自然月、指定自然月某一天、获取前一天和后一天、判断闰年、当月最后一天日期、月末最后一天
- JS获取两个日期工作日相差的小时数(不包含周末)----可以指定一天的上班时间
- js得到连两个时间段之间所有的年-月 获取当前日期 格式化日期 根据指定日期得到该日期该月份的最后一天
- js获取指定日期的后一天
- js判断日期是否是指定月份最后一天
- JS操作日期,获取当前日期,加一天,减一天
- mysql 根据指定日期取 周一至周日 本月第一天 最后一天
- JS 日期操作代码,获取当前日期,加一天,减一天
- java获得指定日期的前一天,后一天的代码
- 获取指定日期的第一天和最后一天
- 1.js 获取日期 指定数字按月累计日期!
- JS插入今明日期文本到指定光标位置
- js 比较yyyy-MM-dd文本日期类型是否在指定的天数内
- js获取月的最后一天日期
- 从指定表中删除指定日期之前的数据, 但保留月末最后一天的数据
- js 将指定日期转换成星期
- JS 日期操作代码,获取当前日期,加一天,减一天
- [DB][ORACLE]取得指定月份的最后一天、在当前日期的基础上加/减月份
- PHP判断某一天在指定日期的前还是后
- PHP 求指定月份的第一天到最后一天的日期