public class TimeUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.time.format.DateTimeFormatter |
DATE_FORMATTER |
| Modifier | Constructor and Description |
|---|---|
private |
TimeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkTimeInRangeWithSkew(java.util.Date timeToCheck,
java.util.Date startDate,
java.util.Date endDate,
int skewInMinutes)
Checks that a date falls in the interval allowing for a certain clock skew expressed in
minutes.
|
static java.util.Date |
parseDate(java.lang.String date)
Parses a date from string
|
public static boolean checkTimeInRangeWithSkew(java.util.Date timeToCheck,
java.util.Date startDate,
java.util.Date endDate,
int skewInMinutes)
timeToCheck - the time to be checkedstartDate - the start date of the time rangeendDate - the end date of the time rangeskewInMinutes - the clock skew in minutes to take into accounttrue, if the time is in the given range, false otherwisejava.lang.IllegalArgumentException - if passed an illegal time rangepublic static java.util.Date parseDate(java.lang.String date)
date - the date string representation;java.lang.NullPointerException - if date is nulljava.time.format.DateTimeParseException - if the date is in the wrong format