title: Why does SimpleDateFormat.parse accept an invalid date string?
body: <p>I have a java code, that inputs date in a specific format.</p>
  
  <pre><code>static Date parseDate(String userInput){
          DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
          Date date = null;
          try {
              date = format.parse(userInput);
              System.out.println(date);
          }catch(ParseException pe){
              date=null;
              System.out.println("Not a valid date");
          }
          return date;
      }
  </code></pre>
  
  <p>Now I'm entering <code>2015-13-11 89:90:90</code> which is an invalid date. But it returns <code>Thu Jan 14 18:31:30 IST 2016</code> as the date. Why is this so? How do I make it to return null as the date?</p>