title: set timezone per request in spring
body: <p>I have data in DB in <code>UTC</code> timezone and some logic on client which is timezone-specific.</p>
  
  <p>There was a decision to return data from server in user's timezone, so there is a flow:</p>
  
  <ol>
  <li>client-side detects user's timezone via javascript</li>
  <li>sends it in custom header (i.e. <code>"X-TIMEZONE"</code>)</li>
  <li>server intercepts request (in <code>Filter</code>) and sets current timezone for it (per-request)</li>
  <li>server handles conversions and returns data to users in his timezone</li>
  </ol>
  
  <p>So the problem is set request-scoped timezone, is it even possible?</p>
  
  <p>I found out that <code>Timezone.setDefault()</code> sets timezone for application in general.</p>
  
  <p>Thanks.</p>