#方法一
Date1.after(Date2),当Date1大于Date2时,返回TRUE,当小于等于时,返回false;
Date1.before(Date2),当Date1小于Date2时,返回TRUE,当大于等于时,返回false;
#方法二
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date d1 = df.parse("2004-03-26 13:31:40");
Date d2 = df.parse("2004-01-02 11:30:24");
long diff = d1.getTime() - d2.getTime();
long days = diff / (1000 * 60 * 60 * 24);