Allow `LocalDate` to be serialized/deserialized as number (epoch day)
See original GitHub issueThe LocalDateSerializer
only supports serializing LocalDate
instances as strings or arrays, both of which suffer from localization issues (“is it year-month-day or year-day-month?”).
An alternative would be to use LocalDate#toEpochDay()
and LocalDate#ofEpochDay(long)
, thus allowing a (less human readable but) unambiguous format.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Jackson: deserialize epoch to LocalDate - java - Stack Overflow
How can I deserialize epoch to LocalDate ? I would like to add that if I change the datatype from LocalDate to java.util.Date...
Read more >Serializing LocalDate to JSON in Spring Boot - Reflectoring
Today, I stumbled (once again) over LocalDate in a Spring Boot application. LocalDate came with Java 8 and is part of the new...
Read more >Serialize Date by using Jackson - Javatpoint
In order to serialize the "java.util.Date", we take the help of the Event class. We first create a date by using SimpleDateFormat class....
Read more >Jackson Date - Baeldung
It's important to note that Jackson will serialize the Date to a timestamp format by default (number of milliseconds since January 1st, ...
Read more >LocalDate (Java SE 10 & JDK 10 ) - Oracle Help Center
LocalDate is an immutable date-time object that represents a date, often viewed as year-month-day. Other date fields, such as day-of-year, day-of-week and week- ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If there is indeed variant to convert to/from
long
, supporting@JsonFormat(shape=Shape.NUMBER)
would make sense I think? Support should also require deserializer handling.As per notes on PR, will merge as soon as we get CLA; will make it in 2.9(.0.pr3)