title: Thymeleaf Temporals and dates with Timezone
body: <p>I've a Spring Boot Web application using Thymeleaf as View Layer and I need to show some dates with a specific Timezone (CET = UTC+1/UTC+2).</p>
  <p>The server is set for UTC and all dates are stored in my DB as datetime in UTC format too and that's fine.</p>
  <p>Now I want to show this dates on my HTML pages not in UTC format but in CET using Thymeleaf Temporals but it seem doesn't work.</p>
  <p>The date object is a Java Instant.</p>
  <p>The retrieved date from DB is (for example) <code>2021-02-17T16:18:21Z</code> and is display like:</p>
  <pre><code>&lt;div th:text=&quot;${#temporals.format(user.lastAccess, 'dd/MM/yyyy HH:mm')}&quot;&gt;&lt;/div&gt;
  =&gt; 17/02/2021 16:18
  </code></pre>
  <p>But I want to show it like:</p>
  <pre><code>17/02/2021 17:18
  </code></pre>
  <p>so I used:</p>
  
  <p>or</p>
  <pre><code>&lt;div th:text=&quot;${#temporals.format(user.lastAccess, 'dd/MM/yyyy HH:mm', new java.util.Locale('it', 'IT'))}&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>But the date is always displayed as UTC</p>
  <pre><code>17/02/2021 16:18
  </code></pre>
  <p>The <code>Java8TimeDialect</code> for Thymeleaf is correctly configured.</p>
  <p>I'm using:</p>
  <pre><code>Spring Boot 2.2.4
  Thymeleaf 3.0.11.RELEASE
  </code></pre>
  <p>What am I doing wrong?</p>
  <p>Thanks.</p>