# 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