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

booleanisData(long date)
is Data
return !"".equals(formattaData(date));
booleanisDataOra(String date)
is Data Ora
Date d = toDateTime(date);
return d != null && _dataOra.format(d).equals(date);
booleanisDate(final String date)
Returns whether or not the string can be parsed as a date.
DateFormat format = DateFormat.getDateInstance();
try {
    format.parse(date);
    return true;
} catch (Exception e) {
    return false;
booleanisDate(final String date)
Checks if is date.
boolean result;
try {
    DATE.parse(date);
    result = true;
} catch (ParseException e) {
    result = false;
return result;
...
booleanisDate(final String dateString)
is Date
DateFormat formatter;
try {
    formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
    formatter.parse(dateString);
    return true;
} catch (final ParseException d) {
    try {
        formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
...
booleanisDate(final String strDate, final String pattern)
Checks if is date.
try {
    parseDate(strDate, pattern);
    return true;
} catch (final Exception e) {
    return false;
booleanisDate(Object object)
is Date
if (object == null)
    return false;
if (object instanceof Date)
    return true;
String str = object.toString();
for (String format : DATE_FORMATS) {
    try {
        Date i = new SimpleDateFormat(format).parse(str);
...
booleanisDate(String date)
is Date
try {
    return java.text.DateFormat.getDateInstance().parse(date) != null;
} catch (java.text.ParseException e) {
    return false;
booleanisDate(String dateStr, String dateFormat)
is Date
boolean isDate = true;
Pattern pattern = Pattern.compile(dateRegx);
Matcher matcher = pattern.matcher(dateStr);
if (matcher.matches()) {
    try {
        stringToDate(dateStr, dateFormat);
    } catch (Exception e) {
        isDate = false;
...
booleanisDate(String dateString)
is Date
return tryParse(dateString);