在属性中加上@JsonFormat注解即可,后面时区为东八区时间
例:
@Column(name = “update_date”)
@JsonFormat(pattern =“yyyy-MM-dd HH:mm:ss”, timezone = “GMT+08:00”)
private Date updateDate;
java关于数据查询返回时间格式为时间戳问题
最新推荐文章于 2024-03-25 11:16:59 发布
在属性中加上@JsonFormat注解即可,后面时区为东八区时间
例:
@Column(name = “update_date”)
@JsonFormat(pattern =“yyyy-MM-dd HH:mm:ss”, timezone = “GMT+08:00”)
private Date updateDate;