@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") //入参
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") //出参
传入的参数必须是跟后台配置的参数一致,不然会抛异常。
public class DateVo {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private Date date;
public void setDate(Date date){
this.date = date;
}
public Date getDate(){
return date;
}
}