/** 获取两个日期相差的天数 **/
public static long getQuot(String time1, String time2){
long quot = 0;
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date1 = ft.parse( time1 );
Date date2 = ft.parse( time2 );
quot = date1.getTime() - date2.getTime();
quot = quot / 1000 / 60 / 60 / 24;
} catch (ParseException e) {
e.printStackTrace();
}
return quot;
}
/** 比较两个日期的大小 **/
public static boolean compareDate(String time1, String time2){
boolean b = false;
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd");
try{
Date date1 = ft.parse( time1 );
Date date2 = ft.parse( time2 );
if(date1.getTime() > date2.getTime()){
b = true;
}
}catch(ParseException e){
e.printStackTrace();
}
return b;
}