java 中时间的显示 (时间问题小坑)
1.后台往前台传时间时 时间格式有问题
//后台往前台传时间的时候时间的格式不对就要在getter上加JsonFormat,
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
public Date getVdate() {
return vdate;
}
```
## 1.2 前台往后台传时间的时候(报400错误,类型不匹配)
//前台往后台传时间的时候格式不对就要在setter上@DateTimeFormat
@DateTimeFormat(pattern = "yyyy-MM-dd")
public void setBeginDate(Date beginDate) {
this.beginDate = beginDate;
}