Jackson deserialize date from Twitter to `ZonedDateTime`

前端 未结 2 979
轮回少年
轮回少年 2020-12-10 22:17

I want to deserialize date from Twitter to ZonedDateTime. My program fails on the created_at field deserializing.

My Domain class



        
2条回答
  •  春和景丽
    2020-12-10 23:21

    Try to add this annotation over your property

    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="EEE MMM dd HH:mm:ss Z yyyy")
    @JsonProperty("created_at") 
    ZonedDateTime created_at;
    

提交回复
热议问题