title: Convert String datetime to Date in java?
body: <p>I am trying to convert these two strings to date and I am getting exception unparseable date.</p>
  
  <p>"2015-12-03T15:00:08.868987" and "2015-12-03T17:00:08Z".Tried these two formats
  "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" and "yyyy-MM-dd'T'HH:mm:ss.SSSZ"</p>
  
  <pre><code>    String s = "2015-12-03T17:00:08Z";
      SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
      try
      {
          Date date = simpleDateFormat.parse(s);
  
          System.out.println("date : "+simpleDateFormat.format(date));
      }
      catch (ParseException ex)
      {
          System.out.println("Exception "+ex);
      }
  </code></pre>