因为全局设置了日期格式化,时间格式都是:yyyy-MM-dd HH:mm:ss,但是业务需求需要返回和接受yyyy-MM-dd格式的参数 解决方案:在实体里的字段上添加@JsonFormat注解 方式一: @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date createTime;