function GetDateStr(AddDayCount) {
var dd = new Date();
dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
var y = dd.getFullYear();
var m = dd.getMonth()+1;//获取当前月份的日期
var d = dd.getDate();
var h = dd.getHours();
var f = dd.getMinutes();
if (m >= 1 && m <= 9) {
m = "0" + m;
}
if (d >= 0 && d <= 9) {
d = "0" + d;
}
if (h >= 0 && h <= 9) {
h = "0" + h;
}
if (f >= 0 && f <= 9) {
f = "0" + f;
}
return y+"-"+m+"-"+d+" "+h+":"+f;
}
明天:GetDateStr(1)
昨天:GetDateStr(-1)