Deserialize “Zulu” time in ISO8601 format in jackson

前端 未结 3 1560
傲寒
傲寒 2021-01-19 14:16

I have a need to de-serialize time of format 2016-11-28T10:34:25.097Z using Jackson into ZonedDateTime of Java8.

I believe I correctly configured O

3条回答
  •  耶瑟儿~
    2021-01-19 14:36

    In my optinion the following JsonFormat for ISO 8601

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
    

    is much better, since this format is more intuitive to read and allows timezones like ACST with UTC offset of +09:30 too.

提交回复
热议问题