title: Milliseconds to Date in GMT in Java
body: <p>I need to covert milliseconds to GMT date (in Android app), example:</p>
  
  <p><code>1372916493000</code></p>
  
  <p>When I convert it by this code:</p>
  
  <pre><code>Calendar cal = Calendar.getInstance();
  cal.setTimeZone(TimeZone.getTimeZone("GMT"));
  cal.setTimeInMillis(millis);
  Date date = cal.getTime();
  </code></pre>
  
  <p>the result is <code>07:41 07/04/2013</code>. The result is the same when I use just:</p>
  
  <pre><code>Date date = new Date(millis);
  </code></pre>
  
  <p>Unfortunately the result looks incorrect, it looks like my local time. I tried to convert the same number by <a href="http://www.fileformat.info/tip/java/date2millis.htm" rel="nofollow">this service</a> and the result is <code>05:41 07/04/2013</code>, which I believe is correct. So I have two hours difference. Anybody has any suggestion / tips what's wrong with my conversion?</p>