List of utility methods to do SQL Date Check
boolean | isChunjie(String date) is Chunjie if (initChunJie().containsKey(date)) { return true; return false; |
boolean | isDataTypeDate(int dataType) Returns true if dataType is a valid date data type return dataType == Types.DATE || dataType == Types.TIMESTAMP || dataType == Types.TIME;
|
boolean | isDate(final PropertyDescriptor pd) is Date return pd.getPropertyType().isAssignableFrom(java.sql.Date.class); |
boolean | isDate(int colType) Checks whether the given column type represents a date-like type. return (colType == Types.DATE) || (colType == Types.TIME) || (colType == Types.TIMESTAMP);
|
boolean | isDate(int dataType) is Date switch (dataType) { case java.sql.Types.DATE: case java.sql.Types.TIME: case java.sql.Types.TIMESTAMP: return true; default: return false; |
boolean | isDate(int dataType) is Date List<Integer> validTypes = Arrays.asList(Types.DATE, Types.TIME, Types.TIMESTAMP);
return validTypes.contains(dataType);
|
boolean | isDate(Object obj) is Date if (obj == null) return false; return obj instanceof java.sql.Date || obj instanceof java.util.Date; |
boolean | isDate(String str) is Date if (!Strings.isNullOrEmpty(str) && str.matches(DATE)) { Calendar cal1 = Calendar.getInstance(); Calendar cal2 = Calendar.getInstance(); cal1.setTime(java.sql.Date.valueOf(str)); cal2.setTimeInMillis(new java.util.Date().getTime()); return Math.abs(cal1.get(Calendar.YEAR) - cal2.get(Calendar.YEAR)) <= 50; return false; ... |
boolean | isDate(String val) is Date try { Date.valueOf(val); return true; } catch (IllegalArgumentException ie) { return false; |
boolean | isDateOneAfterDateTwo(Date dateOne, Date dateTwo) is Date One After Date Two boolean valid = false; if (dateOne != null && dateTwo != null && dateOne.after(dateTwo)) { valid = true; return valid; |