Deserialize Java 8 LocalDateTime with JacksonMapper

后端 未结 6 1249
孤城傲影
孤城傲影 2020-11-28 09:30

I have read several questions with answers here in SO concerning serialization and deserialization between java.time.LocalDateTime and JSON property but I can\'

6条回答
  •  悲&欢浪女
    2020-11-28 10:20

    You used wrong letter case for year in line:

    @JsonFormat(pattern = "YYYY-MM-dd HH:mm")
    

    Should be:

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    

    With this change everything is working as expected.

提交回复
热议问题