| | |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.TimeZone; |
| | | |
| | | /** |
| | | * @author lgh |
| | | */ |
| | |
| | | SpringApplication.run(WebApplication.class, args); |
| | | } |
| | | |
| | | @PostConstruct |
| | | void init() { |
| | | // 强制设置默认时区(影响整个JVM) |
| | | TimeZone.setDefault(TimeZone.getTimeZone("Europe/Paris")); |
| | | System.setProperty("user.timezone", "Europe/Paris"); |
| | | } |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { |
| | | |