public static Long cutTwoDateToDay(Date beginDate, Date endDate, boolean inputFlag) {
Calendar calendar = Calendar.getInstance();
long intervalDays = 0;
calendar.setTime(beginDate);
long begin = calendar.getTimeInMillis();
calendar.setTime(endDate);
long end = calendar.getTimeInMillis();
long totalM = end - begin;
intervalDays = totalM / (24 * 60 * 60 * 1000);
if (inputFlag) {
if (totalM > 0L && totalM % (24 * 60 * 60 * 1000) > 0L) {
intervalDays = intervalDays + 1;
}
}
return intervalDays;
}
Calendar calendar = Calendar.getInstance();
long intervalDays = 0;
calendar.setTime(beginDate);
long begin = calendar.getTimeInMillis();
calendar.setTime(endDate);
long end = calendar.getTimeInMillis();
long totalM = end - begin;
intervalDays = totalM / (24 * 60 * 60 * 1000);
if (inputFlag) {
if (totalM > 0L && totalM % (24 * 60 * 60 * 1000) > 0L) {
intervalDays = intervalDays + 1;
}
}
return intervalDays;
}