gkopff / gson-javatime-serialisers

A set of GSON serialiser/deserialisers for dealing with Java 8 java.time entities.
MIT License
87 stars 19 forks source link

Does InstantConverter support UTC offset values? #21

Open coferc opened 7 years ago

coferc commented 7 years ago

Can I deserialize a value using InstantConverter that includes a UTC offset like, "2017-04-22T00:00:00-04:00", or does the string have to be in UTC? I think the answer is that it doesn't support UTC offset, because I tried and it didn't work, but that could be user error. Thanks!

gkopff commented 7 years ago

To cope with an offset, you'll need to use an OffsetDateTime and the OffsetDateTimeConverter.

You are right that the InstantConverter cannot cope with an offset.

gkopff commented 7 years ago

Pull requests welcome. :-)