/**
* 计算两个日期之间的天数
* @param startDate
* @param endDate
* @return
*/
public static long daysBetweenTwoDate(Date startDate , Date endDate ){
long daysBetweenTwoDate = 0;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd" );
try {
startDate = simpleDateFormat .parse(simpleDateFormat .format(startDate ));
endDate = simpleDateFormat .parse(simpleDateFormat .format(endDate ));
} catch (ParseException e) {
logger.error( "日期转换失败:" + e .getMessage(), e);
}
int nd = 1000 * 24 * 60 * 60;
daysBetweenTwoDate = ( endDate .getTime() - startDate.getTime()) / nd;
return daysBetweenTwoDate;
}