I am using java OffsetDateTime
to store time both on the client and server side.
When I am sending the time information to the server, the local date time part looks like:
"2021-06-15T15:43:50"
and the offset is +02:00
(Central European Summer Time).
However, when the time reaches my spring boot REST Service, it is deserialized as:
"2021-06-15T13:43:50"
with NO offset.
Both the client AND the server are on the same host in central europe (my developper machine).
the field that is being serialized looks like this:
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSX") private OffsetDateTime lastWriteTime;
Why do I have the zero offset on the server side? How can I have the "local" offset on the server side, too?