Class DateHelper
- java.lang.Object
 - 
- org.nuxeo.elasticsearch.aggregate.DateHelper
 
 
- 
public final class DateHelper extends Object
Helper to add duration to a date with the same format as ES Date histogram interval- Since:
 - 8.4
 
 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ZonedDateTimeplusDuration(ZonedDateTime origin, String duration)Returns a new ZonedDateTime plus the specified duration. 
 - 
 
- 
- 
Method Detail
- 
plusDuration
public static ZonedDateTime plusDuration(ZonedDateTime origin, String duration)
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
 
 - 
 
 -