public static Integer getValidDays(Date begin, Date end) {
        ZoneId zoneId = ZoneId.systemDefault();

        LocalDate createLocalDate = begin.toInstant().atZone(zoneId).toLocalDate();
        LocalDate dueLocalDate = end.toInstant().atZone(zoneId).toLocalDate();

        return Math.toIntExact(dueLocalDate.toEpochDay() - createLocalDate.toEpochDay());
    }
Get valid days from the beginning date to the end date.

@param begin begin date
@param end due date
@return valid days
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/util/DateUtils.java