Class DateHelper
java.lang.Object
org.nuxeo.elasticsearch.aggregate.DateHelper
Helper to add duration to a date with the same format as ES Date histogram interval
- Since:
- 8.4
-
Method Summary
Modifier and TypeMethodDescriptionstatic ZonedDateTime
plusDuration
(ZonedDateTime origin, String duration) Returns a new ZonedDateTime plus the specified duration.
-
Method Details
-
plusDuration
Returns a new ZonedDateTime plus the specified duration.- Parameters:
origin
- the initial ZonedDateTimeduration
- can be expressed with a noun: hour, day, month, quarter, year or expression: 2d, 3h, 5w, 2M, 3y or a number of ms: 1234- Returns:
- a new ZonedDateTime
- Throws:
IllegalArgumentException
- if the duration cannot be parsed
-