Skip to content

Commit d659d70

Browse files
committed
Update README to version 0.2
1 parent d10d5a4 commit d659d70

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/date-math-e
88
# Example
99
```java
1010
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"))
1313
.build();
1414
dateMathParser.resolveExpression("1998-09-18 16-43||-4d");
1515
```
1616
# API
1717
## Parser
1818
### DateMathParser
19-
#### long resolveExpression(String Expression)
19+
#### ZonedDateTime resolveExpression(String Expression)
2020
```java
2121
// gets the current datetime and subtracts 5 days
2222
dateMathParser.resolveExpression("now-5d");
@@ -31,17 +31,17 @@ dateMathParser.resolveExpression("2017-07-18||+5m");
3131
#### DateMathBuilder pattern(String pattern)
3232
```java
3333
// creates a new instance from the current with the new pattern
34-
dateMathBuilder.pattern("YYYY-MM-dd");
34+
dateMathBuilder.pattern("yyyy-MM-dd");
3535
```
3636
#### DateMathBuilder zone(DateTimeZone zone)
3737
```java
3838
// 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"));
4040
```
41-
#### DateMathBuilder now(LongSupplier nowSupplier)
41+
#### DateMathBuilder now(Supplier<ZonedDateTime> nowSupplier)
4242
```java
4343
// 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")));
4545
```
4646
#### DateMathBuilder nowPattern(String nowPattern)
4747
```java

0 commit comments

Comments
 (0)