Java Utililty Methods Date Value Check

List of utility methods to do Date Value Check

Description

The list of methods to do Date Value Check are organized into topic(s).

Method

booleanisValidDateInternal(String date, String dateFormat)
is Valid Date Internal
try {
    DateFormat df = new SimpleDateFormat(dateFormat);
    df.setLenient(false);
    df.parse(date);
    return true;
} catch (ParseException e) {
    return false;
booleanisValidDatePattern(String pattern)
is Valid Date Pattern
return isValidDatePattern(pattern, null);
booleanisValidDatePatterns(String dateStr, String patterns)
is Valid Date Patterns
if (patterns == null || "".equalsIgnoreCase(patterns) || patterns.length() < 1) {
    patterns = "yyyy-MM-dd;dd/MM/yyyy;yyyy/MM/dd;yyyy/M/d h:mm";
boolean isValid = false;
String[] patternArr = patterns.split(";");
for (int i = 0; i < patternArr.length; i++) {
    try {
        SimpleDateFormat sdf = new SimpleDateFormat(patternArr[i]);
...
booleanisValidDateStr(String date, String format)
is Valid Date Str
try {
    if (date.length() != format.length()) {
        return false;
    SimpleDateFormat sdf = new SimpleDateFormat(format);
    sdf.setLenient(false);
    sdf.parse(date);
} catch (Exception e) {
...
booleanisValidGameDate(String gameDate)
is Valid Game Date
try {
    parseDate(gameDate);
} catch (ParseException e) {
    return false;
return true;
booleanisValidLongDateFormat(String strDate)
is Valid Long Date Format
if (strDate.length() != longFormat.length()) {
    return false;
DateFormat df = createNewDateFormat(longFormat);
try {
    df.parse(strDate);
} catch (ParseException e) {
    return false;
...
booleanisValidObjectModelDate(String aDate)
is Valid Object Model Date
if (aDate == null) {
    return true;
if (aDate.equals("")) {
    return true;
SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd");
if (aDate.length() != 10) {
...
BooleanisValidPattern(String dateString, String pattern)
is Valid Pattern
return parse(dateString, pattern) != null;