码迷,mamicode.com
首页 > 其他好文 > 详细

页面指定固定年月日日期

时间:2014-11-21 18:34:47      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:des   style   io   ar   color   os   sp   for   on   

js方法如下:


function addDate(ymd,day){
    var temp = new Date(ymd);
    temp = temp.valueOf();
    temp = temp + day * 24 * 60 * 60 * 1000;
    temp = new Date(temp);
    return temp.format("yyyy-MM-dd");
}

 

指定固定日期

三个月时间段:

var today = new Date().format("yyyy-MM-dd");

var startDate = addDate(today,-90);

var endDate = addDate(today,-1);

 

 

bubuko.com,布布扣

 

页面指定固定年月日日期

标签:des   style   io   ar   color   os   sp   for   on   

原文地址:http://www.cnblogs.com/msr1019jingzi/p/4113465.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!