Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 886 Bytes

README.md

File metadata and controls

26 lines (16 loc) · 886 Bytes

gson-threeten-serialisers

What is it?

A set of GSON serialiser/deserialisers for dealing with Java 7 "three ten" backport of the java.time entities. Wherever possible, ISO 8601 string representations are used.

Note: if you are using Java 8 then you're in the wrong place - use the gson-javatime-serialisers instead.

Getting it

(Details to be included once released to Maven Central)

Using it

final Gson gson = Converters.registerOffsetDateTime(new GsonBuilder()).create();
final OffsetDateTime original = OffsetDateTime.now();

final String json = gson.toJson(original);
final OffsetDateTime reconstituted = gson.fromJson(json, OffsetDateTime.class);