title: Java 8 LocalDateTime is parsing invalid date
body: <p>I wanted to validate date in client side so I wrote the following code. But instead of getting an exception I am getting a proper date object for 31st of February date string, which is clearly an invalid date. </p>
  
  <pre><code>public class Test {
  
      public static void main(String[] args) {
          String dateFormat = "HH:mm:ss MM/dd/yyyy";
          String dateString = "11:30:59 02/31/2015";
          DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateFormat, Locale.US);
          try {
              LocalDateTime date = LocalDateTime.parse(dateString, dateTimeFormatter);
              System.out.println(date);
          } catch (Exception e) {
              // Throw invalid date message
          }
      }
  }
  </code></pre>
  
  <p><strong>Output</strong> : 2015-02-28T11:30:59</p>
  
  <p>Does anyone know why <code>LocalDateTime</code> is parsing this date instead of throwing an exception.</p>