# JACKSON (JacksonProperties) spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.time-zone=GMT+8
第一個設置就是使用24小時的時間格式;第二個設置就是設置時區爲東八區。html
@JsonFormat private Date modifyDate;
而後,在你想要格式化的屬性上面使用@JsonFormat
註解。git
若是使用了extends WebMvcConfigurationSupport
方式配置,若是想要使用上面的方式配置時間格式,須要將extends WebMvcConfigurationSupport
替換爲implements WebMvcConfigurer
。github