A small method to check if a LocalDataTime is in a Range between to other LocalDateTime - Objects.
private boolean isInDateRange( LocalDateTime upper, LocalDateTime lower, LocalDateTime toCheck) { var isUpper = toCheck.equals(upper); var isLower = toCheck.equals(lower); if (isLower || isUpper) { return true; } return toCheck.isBefore(upper) && toCheck.isAfter(lower); }
The above is the detailed content of Check if date is between two other dates. For more information, please follow other related articles on the PHP Chinese website!