code: public static boolean isValidDate(final String date, final String format, final boolean lenient)
  	{
  		boolean isValid = true;
  		if (date == null || format == null || format.length() <= 0)
  		{
  			return false;
  		}
  		try
  		{
  			final DateFormat df = new SimpleDateFormat(format);
  			df.setLenient(lenient);
  			df.parse(date);
  		}
  		catch (final ParseException | IllegalArgumentException e)
  		{
  			isValid = false;
  		}
  		return isValid;
  	}
docs: Checks if the Date is valid to convert.
  
  @param date
  The Date as String
  @param format
  The Format for the Date to parse
  @param lenient
  Specify whether or not date/time interpretation is to be lenient.
  @return True if the Date is valid otherwise false.