Package org.openhab.core.util
Class DurationUtils
java.lang.Object
org.openhab.core.util.DurationUtils
Static utility methods that are helpful when dealing with
Duration
.- Author:
- Jimmy Tanagra - Initial contribution
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DurationUtils
public DurationUtils()
-
-
Method Details
-
parse
Parses a duration string in ISO-8601 format or a custom format like "1d 1h 15m 30s 500ms" where 'd' stands for days, 'h' for hours, 'm' for minutes, 's' for seconds, and 'ms' for milliseconds.- Parameters:
durationString
- the string representation of the duration- Returns:
- a Duration object representing the parsed duration
- Throws:
IllegalArgumentException
- if the string cannot be parsed into a valid duration
-