比较两个日期的大小
public void test17() throws ParseException{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date(); // 2017-06-05 15:36:25
Date date1 = sdf.parse( "2017-06-05 16:26:25");
System.out.println(date.compareTo(date1)); // -1 date < date1
date1 = sdf.parse("2017-06-05 12:26:25");
System.out.println(date.compareTo(date1)); // 1 date > date1
date1 = new Date();
System.out.println(date.compareTo(date1)); // 0 date = date1
}