获取两个Date类型的天数差,时差,分差
public static int getDateInterValDay(Date begin,Date end){
return (int) ((end.getTime() - begin.getTime()) / (24 * 60 * 60 * 1000));
}
public static int getDateInterValHour(Date begin,Date end){
return (int) ((end.getTime() - begin.getTime()) / (60 * 60 * 1000));
}
public static int getDateInterValSecond(Date begin,Date end){
return (int) ((end.getTime() - begin.getTime()) / (60 * 1000));
}