时区问题"/>
spring boot 时区问题
方式一:
修改配置文件 application.properties
spring.jackson.time-zone=UTC
方式二:
在启动类上加
@PostConstructvoid setDefaultTimezone() {TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
} public static void main(String[] args) {log.info("Starting Spring Boot Application.");SpringApplication.run(ReportingServicesApplication.class, args);
}
方式三:
在启动类 启动run方法上加
public static void main(String[] args) {TimeZone.setDefault(TimeZone.getTimeZone("UTC"));SpringApplication.run(BaseMicroServiceApplication.class, args);
}
更多推荐
spring boot 时区问题
发布评论