@@ -8,15 +8,15 @@ https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/date-math-e
8
8
# Example
9
9
``` java
10
10
DateMathParser dateMathParser = new DateMathBuilder ()
11
- .pattern(" YYYY -MM-dd HH-ss" )
12
- .zone(DateTimeZone . forID (" America/New_York" ))
11
+ .pattern(" yyyy -MM-dd HH-ss" )
12
+ .zone(ZoneId . of (" America/New_York" ))
13
13
.build();
14
14
dateMathParser. resolveExpression(" 1998-09-18 16-43||-4d" );
15
15
```
16
16
# API
17
17
## Parser
18
18
### DateMathParser
19
- #### long resolveExpression(String Expression)
19
+ #### ZonedDateTime resolveExpression(String Expression)
20
20
``` java
21
21
// gets the current datetime and subtracts 5 days
22
22
dateMathParser. resolveExpression(" now-5d" );
@@ -31,17 +31,17 @@ dateMathParser.resolveExpression("2017-07-18||+5m");
31
31
#### DateMathBuilder pattern(String pattern)
32
32
``` java
33
33
// creates a new instance from the current with the new pattern
34
- dateMathBuilder. pattern(" YYYY -MM-dd" );
34
+ dateMathBuilder. pattern(" yyyy -MM-dd" );
35
35
```
36
36
#### DateMathBuilder zone(DateTimeZone zone)
37
37
``` java
38
38
// creates a new instance from the current with the new zone
39
- dateMathBuilder. zone(DateTimeZone . forID (" America/New_York" ));
39
+ dateMathBuilder. zone(ZoneId . of (" America/New_York" ));
40
40
```
41
- #### DateMathBuilder now(LongSupplier nowSupplier)
41
+ #### DateMathBuilder now(Supplier< ZonedDateTime > nowSupplier)
42
42
``` java
43
43
// creates a new instance from the current with the new nowSupplier
44
- dateMathBuilder. now(() - > DateTime . now() . getMillis( ));
44
+ dateMathBuilder. now(() - > ZonedDateTime . now(ZoneId . of( " America/New_York " ) ));
45
45
```
46
46
#### DateMathBuilder nowPattern(String nowPattern)
47
47
``` java
0 commit comments