(转)mybatis + mysql date时间前端展示样式问题 2020-11-22T15:14:12.000+0000
问题:使用 mybatis 读取 mysql的date时间类型,查询结果类型为2019-04-17T16:00:00.000+0000
解决方法如下:
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
public Date getHuifutime() {
return huifutime;
}
注:在model类中的时间属性的get方法上增加注解,timezone = "GMT+8"
结果如下图:
原创
2020-11-26 09:21:52 ·
306 阅读 ·
0 评论