Package org.openremote.model.util
Class TimeUtil
java.lang.Object
org.openremote.model.util.TimeUtil
A helper class with utility methods for
time related operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final DateTimeFormatter
protected static final Pattern
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isTimeDuration
(String time) static boolean
static boolean
static long
parseTimeDuration
(String duration) Parses the given time duration String and returns the corresponding number of milliseconds.static Instant
parseTimeIso8601
(CharSequence datetime) Parses ISO8601 strings with optional time and/or offset; if no zone is provided then UTC is assumed if no time is provided then 00:00:00 is assumed.
-
Field Details
-
SIMPLE
-
formatter
-
-
Constructor Details
-
TimeUtil
public TimeUtil()
-
-
Method Details
-
parseTimeDuration
Parses the given time duration String and returns the corresponding number of milliseconds.- Throws:
NullPointerException
- if time is null
-
isTimeDuration
-
isTimeDurationPositiveInfinity
-
isTimeDurationNegativeInfinity
-
parseTimeIso8601
Parses ISO8601 strings with optional time and/or offset; if no zone is provided then UTC is assumed if no time is provided then 00:00:00 is assumed.
-