我写了一个日期大小的比较类 
代码如下public boolean dateMaxCompare(Date date, Date anotherDate){
java.util.Calendar   cal   =   java.util.Calendar.getInstance();   
cal.setTime(anotherDate);
anotherDate =cal.getTime();
cal.setTime(date);
boolean   after  =   cal.after(anotherDate);
if(after){
  return true;
 }
  
else{
return false;
}
}
其中的anotherDate 格式是yyyy-mm-hh:mm:ss  date是通过new Date()得到的
然后我先把anotherDate 通过SetTime 函数转换成与date格式相同的日期 再比较
但是数据库中得到了anotherDate  2007-04-30 18:22:22 与今天的五月一号比较
after函数返回的是false 请帮帮忙 是不能比较呢 还是怎么回事