//两日期相减date1:小日期 date2:大日期
function DateMinus(date1,date2)
{
var sdate = new Date(date1);
var now = new Date(date2);
var days = now.getTime() - sdate.getTime();
var day = parseInt(days / (1000 * 60 * 60 * 24));
return day;
}
//获取日期,年,月,日
function getdate()
{
var now=new Date();
var y=now.getFullYear();
var m=now.getMonth()+1;
var d=now.getDate();
m=m <10?"0"+m:m;
d=d <10?"0"+d:d;
return y+"-"+m+"-"+d;
}