List of utility methods to do Date Value Check
boolean | isValidDate(String date) is Valid Date return isValidDateInternal(date, DATE_FORMAT);
|
boolean | isValidDate(String date, String dateFormat) is Valid Date try { new SimpleDateFormat(dateFormat).parse(date); return true; } catch (Exception e) { return false; |
boolean | isValidDate(String date, String format) Tests the input string to ensure that a valid Date instance can be created from it according to the format provided. if (date == null) return false; try { parse(date, format); } catch (java.text.ParseException e) { return false; return true; ... |
boolean | isValidDate(String dateStr) is Valid Date boolean isValid = false; if (dateStr == null || dateStr.length() <= 0) { return false; String pattern = "yyyy-MM-dd"; try { SimpleDateFormat sdf = new SimpleDateFormat(pattern); String date = sdf.format(sdf.parse(dateStr)); ... |
boolean | isValidDate(String dateString) Checks whether the actual date of the given date string is valid. try { parse(dateString); return true; } catch (ParseException e) { return false; |
boolean | isValidDate(String dateString) is Valid Date try { dateFormat.parse(dateString); return true; } catch (Exception e) { return false; |
boolean | isValidDate(String dateString, String dateFormat) Checks whether the actual date of the given date string is valid based on the given date format pattern. try { parse(dateString, dateFormat); return true; } catch (ParseException e) { return false; |
boolean | isValidDate(String dateString, String dateFormat) is Valid Date if (dateString != null && (dateString.length() > 0)) { try { DateFormat df = new SimpleDateFormat(dateFormat); df.setLenient(false); df.parse(dateString); return true; } catch (ParseException e) { return false; ... |
boolean | isValidDate(String dateString, String dateFormat) Checks whether the actual date of the given date string is valid based on the given date format pattern. try { parse(dateString, dateFormat); return true; } catch (ParseException e) { return false; |
boolean | isValidDate(String dateString, String dateFormat) Checks whether the actual date of the given date string is valid based on the given date format pattern. try { parse(dateString, dateFormat); return true; } catch (ParseException e) { return false; |