title: Java: How do you convert a UTC timestamp to local time?
body: <p>I have a timestamp that's in UTC and I want to convert it to local time without using an API call like <code>TimeZone.getTimeZone("PST")</code>.  How exactly are you supposed to do this?  I've been using the following code without much success:</p>
  
  <pre><code>private static final SimpleDateFormat mSegmentStartTimeFormatter = new        SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
  
  Calendar calendar = Calendar.getInstance();
  
      try {
          calendar.setTime(mSegmentStartTimeFormatter.parse(startTime));
      }
      catch (ParseException e) {
          e.printStackTrace();
      }
  
      return calendar.getTimeInMillis();
  </code></pre>
  
  <p>Sample input value: <code>[2012-08-15T22:56:02.038Z]</code></p>
  
  <p>should return the equivalent of <code>[2012-08-15T15:56:02.038Z]</code></p>