public class JodaDateMathParser extends Object implements DateMathParser
Constructor and Description |
---|
JodaDateMathParser(JodaDateFormatter dateTimeFormatter) |
Modifier and Type | Method and Description |
---|---|
long |
parse(String text,
LongSupplier now,
boolean roundUp,
ZoneId tz)
Parse text, that potentially contains date math into the milliseconds since the epoch
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parse, parse
public JodaDateMathParser(JodaDateFormatter dateTimeFormatter)
public long parse(String text, LongSupplier now, boolean roundUp, ZoneId tz) throws ElasticsearchParseException
DateMathParser
Examples are
2014-11-18||-2y
subtracts two years from the input date
now/m
rounds the current time to minute granularity
Supported rounding units are y year M month w week (beginning on a monday) d day h/H hour m minute s second
parse
in interface DateMathParser
text
- the inputnow
- a supplier to retrieve the current date in milliseconds, if needed for additionsroundUp
- should the result be rounded uptz
- an optional timezone that should be applied before returning the milliseconds since the epochElasticsearchParseException
Copyright © 2022. All rights reserved.