解决1:在实体类字段上面添加
@DateTimeFormat("yyyy-MM-dd") @JsonFormat(pattern ="yyyy-MM-dd",timezone = "GMT+8",shape = JsonFormat.Shape.STRING)
解决2:在实现类里面转换
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); String sDate=sdf.format(jskjSfExpresDelivery.getDate()); System.out.println(sDate);