google / google/gson

GSON Serialization/Deserialization of Java 8 Date API

Open
#1,059 15 comments 4 reactions 0 assignees View on GitHub
enhancement java8
Dominant language
Java
Stars
24.2k
Forks
4.5k
Avg merge
6d 4h
Merged PRs (30d)
12

Description

When serializing / deserializing an object with the Date and Time classes of the new java.time API, the results are diferent from expected.

For example, here's a java.util.Date serialized with gson (using version 2.8.0):

**"created": "2017-04-07T18:07:00",**

and here's a java.time.LocalDate:

**"expiration": {
"year": 2017,
"month": 4,
"day": 7
}**
the expected result for javatime api was a ISO-8601.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.