Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! Support for jsonformat in duration deseri…
Browse files Browse the repository at this point in the history
…alizer based on Duration::of(long,TemporalUnit). ref FasterXML#184
  • Loading branch information
obarcelonap committed Oct 14, 2020
1 parent ea37ddc commit 343abbc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions datetime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ times but are supported with this module nonetheless.
[`LocalDateTime`](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html), and
[`OffsetTime`](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetTime.html), which cannot portably be converted to
timestamps and are instead represented as arrays when `WRITE_DATES_AS_TIMESTAMPS` is enabled.
* [`Duration`](https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html), which unit can be configured in `JsonFormat` using a [`ChronoUnit`](https://docs.oracle.com/javase/8/docs/api/java/time/temporal/ChronoUnit.html) as `pattern`. For instance:
```java
@JsonFormat(pattern="MILLIS")
long millis;

@JsonFormat(pattern="SECONDS")
long seconds;

@JsonFormat(pattern="DAYS")
long days;
```

## Usage

Expand Down

0 comments on commit 343abbc

Please sign in to comment.