Js 日期加减天数
2014-02-16 11:09
281 查看
<SCRIPT language="javascript"> function addDate(dd,dadd){ var a = new Date(dd) a = a.valueOf() a = a + dadd * 24 * 60 * 60 * 1000 a = new Date(a) return a; } //抓取现在日期 var now = new Date("2008/03/01"); var years = now.getYear()+1; var months = now.getMonth()+1; var days = now.getDate(); var hours = now.getHours(); //抓取前一天日期 NextNow = addDate(months+"/"+days+"/"+years,-1); years = NextNow.getYear(); months = NextNow.getMonth()+1; days = NextNow.getDate(); alert("加一年减一天的日期:"+years+"年"+months+"月"+days+"日"); </SCRIPT>
相关文章推荐
- Js 日期加减天数 复制代码
- 日期加减天数js
- 如何用js进行日期的加减(天数)?
- js 日期格式化,天数加减
- js 时间计算(加减天数、返回当前时间后一个星期的日期,返回格式yyyy-MM-dd)
- 【js】日期天数加减
- js 的日期加天数 或者加月
- js选择日期即时把两个日期相差天数显示出来?
- JS日期的获取与加减
- JS 比较两个字符串日期相差的天数
- js获取某月的天数以及某天的前一个日期和后一天日期
- JS 获取日期相差天数
- mysql日期加减求出天数
- JS日期加减
- js操作日期加减一天
- js 计算两个日期之间的天数
- JS日期加减,日期运算代码
- js计算日期相差的天数
- 用js进行日期的加减
- js 获取指定日期,剩余天数