title: Convert yyyy-MM-dd'T'HH:mm:ss.mmm'Z' to normal "HH:mm a" format
body: <p>I have a problem in displaying the date in my Application.</p>
  
  <p>I am getting timestamp as:</p>
  
  <blockquote>
    <p>2017-08-02T06:05:30.000Z</p>
  </blockquote>
  
  <p>But as per this the <strong>actual time</strong> is:</p>
  
  <blockquote>
    <p>2017:08:02 11:35 AM</p>
  </blockquote>
  
  <p>But after converting using my code it displays the time as:</p>
  
  <blockquote>
    <p>6:00 am</p>
  </blockquote>
  
  <p>How to show it as current time?</p>
  
  <p>My code is given below:</p>
  
  <pre><code>private static SimpleDateFormat timestampformat = 
                     new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.mmm'Z'");
  
  private static SimpleDateFormat sdftimeformat = new SimpleDateFormat("HH:mm a");
  
  private static SimpleDateFormat getSdftimeformat() {
      return sdftimeformat;
  }
  public static String timeStampConvertToTime(String time) {
      Date date1 = null;
  
      try {
          date1 = timestampformat.parse(time);
      } catch (ParseException e) {
          e.printStackTrace();
      }
      String formattedTime = getSdftimeformat().format(date1);
      return formattedTime;
  }
  </code></pre>