Java Utililty Methods Time Parse

List of utility methods to do Time Parse

Description

The list of methods to do Time Parse are organized into topic(s).

Method

booleanisDatetimeParsable(String value)
is Datetime Parsable
try {
    return DATETIME_FORMATTER.parse(value) != null;
} catch (ParseException e) {
    return false;
booleanisFromartDate(String time)
is Fromart Date
if (time != null) {
    String tmp = null;
    try {
        Format f = new SimpleDateFormat("yyyyMMdd");
        Date d = (Date) f.parseObject(time);
        tmp = f.format(d);
    } catch (ParseException e) {
        e.printStackTrace();
...
booleanisTime(final String date)
Checks if is time.
boolean result;
try {
    TIME.parse(date);
    result = true;
} catch (ParseException e) {
    result = false;
return result;
...
booleanisTime(String timeStr)
is Time
SimpleDateFormat df = new SimpleDateFormat("hh:mm:ss");
Date date = null;
try {
    date = df.parse(timeStr);
} catch (ParseException e) {
    return false;
return date != null;
...
longstrtotime(String strtime)
strtotime
try {
    SimpleDateFormat format = new SimpleDateFormat(TIME_FORMAT);
    return format.parse(strtime).getTime();
} catch (ParseException e) {
    e.printStackTrace();
return 0;