compareTo 时间比较Date dat1=new Date(); Date dat2=new Date();
Date dat1=new Date(); Date dat2=new Date(); int num = dat1.compareTo(dat2); 如果 dat1>dat2 num = 1; dat1=dat2 num = 0; dat1<dat2 num = -1;