title: How do I force a Spring Boot JVM into UTC time zone?
body: <p>I saw <a href="https://stackoverflow.com/questions/2627992/force-java-timezone-as-gmt-utc">Force Java timezone as GMT/UTC</a></p>
  
  <p>I tried</p>
  
  <ul>
  <li>mvn spring-boot:run -Dexec.args="-Duser.timezone=GMT"</li>
  <li>mvn spring-boot:run -Dexec.args="-Duser.timezone=UTC"</li>
  <li><code>user.timezone=UTC</code> in <code>config/application.properties</code></li>
  <li><code>user.timezone=GMT</code></li>
  <li><p>In the pom.xml:</p>
  
  <pre><code>    &lt;plugin&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;configuration&gt;
              &lt;properties&gt;
                &lt;spring-boot.run.jvmArguments&gt;-Duser.timezone=UTC&lt;/spring-boot.run.jvmArguments&gt;
              &lt;/properties&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  </code></pre></li>
  <li>mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Duser.timezone=UTC"</li>
  </ul>
  
  <p>But it prints out</p>
  
  <pre><code>System.out.println(TimeZone.getDefault());
  </code></pre>
  
  <blockquote>
    <p>sun.util.calendar.ZoneInfo[id="America/New_York",offset=-18000000,dstSavings=3600000,useDaylight=true,transitions=235,lastRule=java.util.SimpleTimeZone[id=America/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]]</p>
  </blockquote>
  
  <p>Spring Boot 1.5.19, Java 8</p>