0
点赞
收藏
分享

微信扫一扫

通过@JsonFormat和@DateTimeFormat,解决前后端时间格式问题

NicoalsNC 2023-11-06 阅读 40

在domain层的时间属性上面加@JsonFormat和@DateTimeFormat注解
后端传前端:                                                   GMT+8:表示东八区
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
前端传后端:
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

举报

相关推荐

0 条评论