首页 > 其他分享 >LocalDateTime去掉T,@JsonFormat有效,JSONField失效

LocalDateTime去掉T,@JsonFormat有效,JSONField失效

时间:2022-12-08 10:25:19浏览次数:48  
标签:JsonFormat private yyyy HH LocalDateTime JSONField

@ApiModelProperty(value = "开机时间")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime bootTime;

返回的结果中间有T

"createTime": "2022-07-04T15:09:36"

修改:

@ApiModelProperty(value = "开机时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private LocalDateTime bootTime;

返回的结果

"createTime": "2022-07-04 15:09:36"

标签:JsonFormat,private,yyyy,HH,LocalDateTime,JSONField
From: https://www.cnblogs.com/pxuan/p/16965325.html

相关文章