title: Java 8: How to parse expiration date of debit card?
body: <p>It is really easy to parse expiration date of debit/credit card with Joda time:</p>
  
  <pre><code>org.joda.time.format.DateTimeFormatter dateTimeFormatter = org.joda.time.format.DateTimeFormat.forPattern("MMyy").withZone(DateTimeZone.forID("UTC"));
  org.joda.time.DateTime jodaDateTime = dateTimeFormatter.parseDateTime("0216");
  System.out.println(jodaDateTime);
  </code></pre>
  
  <p>Out: <code>2016-02-01T00:00:00.000Z</code></p>
  
  <p>I tried to do the same but with Java Time API: </p>
  
  <pre><code>java.time.format.DateTimeFormatter formatter = java.time.format.DateTimeFormatter.ofPattern("MMyy").withZone(ZoneId.of("UTC"));
  java.time.LocalDate localDate = java.time.LocalDate.parse("0216", formatter);
  System.out.println(localDate);
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>Caused by: java.time.DateTimeException: Unable to obtain LocalDate
    from TemporalAccessor: {MonthOfYear=2, Year=2016},ISO,UTC of type
    java.time.format.Parsed   at
    java.time.LocalDate.from(LocalDate.java:368)  at
    java.time.format.Parsed.query(Parsed.java:226)    at
    java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
      ... 30 more</p>
  </blockquote>
  
  <p>Where I made a mistake and how to resolve it?</p>