日期:2014-05-16 浏览次数:20398 次
function AddDays(date, days) {
var dd = date.split(/
------解决方案--------------------
-
------解决方案--------------------
:/g);
var nd = new Date(dd[0],dd[1]-1,dd[2],!!dd[3]?dd[3]:0,!!dd[4]?dd[4]:0,!!dd[5]?dd[5]:0);
nd = nd.valueOf();
nd = nd + days * 24 * 60 * 60 * 1000;
nd = new Date(nd);
var y = nd.getFullYear();
var m = nd.getMonth() + 1;
var d = nd.getDate();
if (m <= 9) m = "0" + m;
if (d <= 9) d = "0" + d;
var cdate = y + "-" + m + "-" + d;
return cdate;
}
---------------------------------