J'ai vu fuseau horaire de travail Java GMT / UTC
j'ai essayé
- mvn printemps-boot: exécuter -Dexec.args = "- Duser.timezone = GMT"
- mvn printemps-boot: exécuter -Dexec.args = "- Duser.timezone = UTC"
user.timezone=UTC
dansconfig/application.properties
user.timezone=GMT
Dans le pom.xml:
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <properties> <spring-boot.run.jvmArguments>-Duser.timezone=UTC</spring-boot.run.jvmArguments> </properties> </configuration> </plugin>
- printemps-boot mvn: exécuter -Dspring-boot.run.jvmArguments = "- Duser.timezone = UTC"
Mais il imprime
System.out.println(TimeZone.getDefault());
sun.util.calendar.ZoneInfo [id = "Amérique / New_York", offset = -18.000.000, dstSavings = 3600000, useDaylight = true, transitions = 235, lastRule = java.util.SimpleTimeZone [id = Amérique / New_York, offset = - 18000000, dstSavings = 3600000, useDaylight = true, StartYear = 0, StartMode = 3, startMonth = 2, StartDay = 8, startDayOfWeek = 1, startTime = 7200000, startTimeMode = 0, endMode = 3, endMonth = 10, EndDay = 1, endDayOfWeek = 1, endTime = 7200000, endTimeMode = 0]]
Spring Boot 1.5.19, Java 8
Utilisez la spring-boot.run.jvmArguments
propriété si vous voulez passer des options JVM de Maven Spring Boot Plugin à l' application Boot Spring fourchue:
<properties>
<spring-boot.run.jvmArguments>-Duser.timezone=UTC</spring-boot.run.jvmArguments>
</properties>
Ceci est équivalent à la syntaxe de ligne de commande:
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Duser.timezone=UTC"
ou lors de l'exécution d'une application Spring Boot complètement emballé:
java -Duser.timezone=UTC -jar app.jar