code: private Date attemptParse(SimpleDateFormat format, String input) {
          ParsePosition pos = new ParsePosition(0);
          Date d = format.parse(input, pos);
          if (0 == pos.getIndex() || pos.getIndex() != input.length()) {
              // invalid format matching
              return null;
          }
          return d;
      }
docs: Parse the input value against the formatter but do not throw an exception
  if it fails to match, instead just return null.
  <br>
  
  @param format
  @param input
  @return Date