DateTimeFormat 与 JsonFormat 的区别

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

@JsonFormat 主要是后台到前台的时间格式的转换
@DataTimeFormat 主要是前后到后台的时间格式的转换
参考: https://www.cnblogs.com/mracale/p/9828346.html

posted @ 2022-07-19 17:49  村上春树的叶子  阅读(83)  评论(0编辑  收藏  举报