1添加依賴
<!-- Jackson Json處理工具包 -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.core.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.core.version}</version>
</dependency>
<properties> <jackson.version>1.9.13</jackson.version> <jackson.core.version>2.4.2</jackson.core.version> </properties>
2.在實體類的getter方法上面添加@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
再次嘗試 就會有效果了