title: Converting UTC time in IST
body: <p>I have to convert <code>2017-10-12T09:48:28.338Z</code> to IST i.e <code>dd-MM-yyyy HH:mm:ss</code> . The code i used throws <code>java.lang.IllegalArgumentException: Unknown pattern character 'Y'</code></p>
  
  <p>Here is my code :</p>
  
  <pre><code>private String getStandardTime(String dateStr) {
          SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dddd'T'HH:mm:ss.SSSZ");
          df.setTimeZone(TimeZone.getTimeZone("UTC"));
          Date date = null;
          try {
              date = df.parse(dateStr);
          } catch (ParseException e) {
              e.printStackTrace();
          }
          df.setTimeZone(TimeZone.getDefault());
          String formattedDate = df.format(date);
          return formattedDate;
      }
  </code></pre>
  
  <p>Can anyone help me out here ? What i am doing wrong .
  for reference i checked </p>
  
  <p><a href="http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html#number" rel="nofollow noreferrer">http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html#number</a></p>