title: Parsing a date using DateTimeFormatter ofPattern
body: <p>I'm trying to parse a string containing a date and time using the <code>java.time.format.DateTimeFormatter</code> (my ultimate goal is to get the date from this string into a <code>java.time.LocalDate</code>).</p>
  
  <p>I keep getting DateTimeParseExceptions when trying to parse the date. Can someone help please?</p>
  
  <p>The date is in the format "2015-07-14T11:42:12.000+01:00".</p>
  
  <pre><code>DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyy-MM-ddTHH:mm:ss.SSSZ");
  LocalDateTime temp = LocalDateTime.ofInstant(Instant.from(f.parse(this.dateCreated)), 
                   ZoneId.systemDefault());
  LocalDate localDate = temp.toLocalDate();
  </code></pre>
  
  <p>I've tried different variations in the ofPattern, such as trying to escape the T by surrounding it with single quotes (as done above), and doing the same with the . and I've tried escaping both at the same time.</p>
  
  <p>Do the colons need escaping too?</p>
  
  <p>Appreciate any help with this. </p>