Spring Boot项目——设置时区 操作 在项目启动类里添加如下代码 @PostConstruct void setDefaultTimezone() { //东八区 TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai")); }