title: java.text.ParseException: Unparseable date “yyyy-MM-dd'T'HH:mm:ss.SSSXXX” - SimpleDateFormat
body: <p>I used the follow code to parse <code>datetime</code>:</p>
  
  <pre><code>String parseDate(String tranDateTime, String originalDateFormat, String toDateFormat) throws ParseException {
      SimpleDateFormat originalMonthYear = new SimpleDateFormat(originalDateFormat);
      Date date = originalMonthYear.parse(tranDateTime);
  
      SimpleDateFormat formatter = new SimpleDateFormat(toDateFormat);
      return formatter.format(date);
  }
  </code></pre>
  
  <p>And tried to parse a datetime value as below :</p>
  
  <pre><code>parseDate("2017-08-16T00:00:00Z", 
            "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", "yyyy-MM-dd HH:mm:ss");
  </code></pre>
  
  <p>An exception is thrown :</p>
  
  <blockquote>
    <p>java.text.ParseException: Unparseable date: "2017-08-16T00:00:00Z"</p>
  </blockquote>
  
  <p>However, when I change date value to <code>"2017-08-16T02:54:15.537Z"</code>, the function worked fine. I don't know why.</p>