前后端传值日期格式转换
前后端传值时间格式
@JsonFormat(pattern="HH:mm:ss",timezone = "GMT+8")
private Date startTime; //例如:白班 8:00-16:00
@JsonFormat生效需要以下三个包支持,且需新版本,旧版本不支持
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.3</version>
</dependency>