title: Convert timestamp to Date time for a particular timezone
body: <p>I want to convert a timestamp <code>(which is in GMT)</code> to a <code>local date and time</code>.</p>
  <p>This is what I have implemented so far, but it is giving me wrong month</p>
  <pre><code>Timestamp stp = new Timestamp(1640812878000L);
  Calendar convertTimestamp = convertTimeStamp(stp,&quot;America/Phoenix&quot;);
  System.out.println(convertTimestamp.getTime());
      
  
  public static Calendar convertTimeStamp( Timestamp p_gmtTime, String p_timeZone) throws Exception {
          SimpleDateFormat sdf = new SimpleDateFormat(&quot;MMM dd, yyyy HH:MM:SS a&quot;, Locale.ENGLISH);
          DateFormat formatter = DateFormat.getDateTimeInstance();
          if (p_timeZone != null) {
              formatter.setTimeZone(TimeZone.getTimeZone(p_timeZone));
          } else {
              formatter.setTimeZone(TimeZone.getTimeZone(&quot;GMT&quot;));
          }
  
          String gmt_time = formatter.format(p_gmtTime);
          Calendar cal = Calendar.getInstance();
          cal.setTime(sdf.parse(gmt_time));
          return cal;
      }
  </code></pre>
  <p>Any help would be appreciated.</p>