//增加几天
function DateAdd(day, date) {
var current = new Date(date);
var d = current.getTime() + 1000 * 60 * 60 * 24 * day
return new Date(d);
}
//减去几天
function DateMinus(day, date) {
var current = new Date(date);
var d = current.getTime() - 1000 * 60 * 60 * 24 * day
return new Date(d);
}
//获取当前的时间(yyy-MM-dd)
function getNowFormatDate() {
var date = new Date();
var seperator1 = "-";
var seperator2 = ":";
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + seperator1 + month + seperator1 + strDate;
return currentdate;
}
//日期比较
function getChangedMax(today, date) {
var oT = new Date(today);
var oD = new Date(date);
if (oT.getTime() > oD.getTime()) {
return oD;
} else {
return oT;
}
}
//增加几天function DateAdd(day, date) { var current = new Date(date); var d = current.getTime() + 1000 * 60 * 60 * 24 * day return new Date(d);}//减去几天function DateMinus(day, date) { v