当前位置: 代码迷 >> 综合 >> Springboot 实体中 Date类型传给前端序列化成时间字符串
  详细解决方案

Springboot 实体中 Date类型传给前端序列化成时间字符串

热度:84   发布时间:2024-02-05 01:15:52.0

在实体类Date属性上加上注解

public class ClassModel {private String classCode;private Long classId;private String className;private Long pClassId;private String note;private Long imObjNum;@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")private Date udTime;
}

 

  相关解决方案