//获取日期差,返回相差天数。
//日期格式:2005-01-01
//Author : Meanson Wang
//Email: meansonw@hotmail.com
public static long getCompareDate(String startDate,String endDate) throws ParseException {
SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd");
Date date1=formatter.parse(startDate);
Date date2=formatter.parse(endDate);
long l = date2.getTime() - date1.getTime();
long d = l/(24*60*60*1000);
return d;
}
//日期格式:2005-01-01
//Author : Meanson Wang
//Email: meansonw@hotmail.com
public static long getCompareDate(String startDate,String endDate) throws ParseException {
SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd");
Date date1=formatter.parse(startDate);
Date date2=formatter.parse(endDate);
long l = date2.getTime() - date1.getTime();
long d = l/(24*60*60*1000);
return d;
}