title: Struts2 Date Tag TimeZone behavior
body: <p>I am using <code>&lt;s:date&gt;</code> tag of struts2.</p>
  <p>To convert a date stored <code>04/09/2014 11:40:17</code> in UTC time  to <code>IST</code> time I used struts2 <code>date</code> tag as belows :</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;s:date name = &quot;dateregistered&quot; 
        format = &quot;MM/dd/yyyy HH:mm:ss a&quot; 
      timezone = &quot;GMT+5.30&quot; /&gt;
  </code></pre>
  <p>and it always give me the date: <code>04/09/2014 06:10:17 AM</code>.</p>
  <p>The expected result should be: <code>04/09/2014 05:10:17 PM</code>.</p>
  <p>I am not getting where I am wrong and doing mistake,I am using <code>hibernate</code> to fetch and <code>java.util.date</code> to store the value which is used above</p>
  <p><strong>The process how data was stored and retrived:</strong></p>
  <p>I stored value in mysql through hibernate:</p>
  <pre class="lang-xml prettyprint-override"><code>TimeZone.setDefault(TimeZone.getTimeZone(&quot;Etc/UTC&quot;));
  user.setCreatedDateTime(new java.util.Date());
  ...
  ...
  ...
  </code></pre>
  <p>Now I am getting the value from DB as <code>04/09/2014 11:40:17</code> . When I performed this insertion the actual time was <code>04/09/2014 05:10:17 PM</code> <code>IST</code> . So it clears that the time being stored in DB is UTC time.</p>
  <p>Now I am retriving time and setting in map in key value pair as <code>map.put(&quot;dateregistered&quot;,c.getCreatedDateTime());</code></p>
  <pre class="lang-xml prettyprint-override"><code>user.getCreatedDateTime()
  </code></pre>
  <p>and retrieving value using struts 2 tag as mentioned above</p>