Java Utililty Methods Year Parse

List of utility methods to do Year Parse

Description

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

Method

Dateparse2yyyyMMddHHmmss(String date)
parseyyyy M Mdd H Hmmss
return parseDate(date, yyyyMMddHHmmss);
DateparseDashedDateDDMMYYYY(String date)
Parses the specified date in dd-MM-yyyy format and returns the Date instance using the system default time zone.
SimpleDateFormat f = new SimpleDateFormat(DATE_FORMAT_DASHED_DD_MM_YYYY);
f.setTimeZone(TimeZone.getDefault());
return f.parse(date);
DateparseDateSlashedMmDdYyyy(String dateStr)
parse Date Slashed Mm Dd Yyyy
return parseDate(formatSlashedMmDdYyyy(), dateStr);
DateparseDateTime_mmddyyyy(String s)
parse Date Timmmddyyyy
if (s == null)
    return null;
return dfDateTime_mmddyyyy.parse(s);
java.util.DateparseDateyyyy_MM_DD2(String ds)
parse DateyyyMDD
return new java.util.Date(new SimpleDateFormat(DATE_FORMAT_yyyy_MM_dd).parse(ds).getTime());
DateparseDateyyyyMMdd(String value)
Parse date in format yyyyMMdd.
try {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
    return sdf.parse(value);
} catch (ParseException e) {
    throw new IllegalArgumentException(
            "Cannot parse date, value=[" + value + "]. Expected format is yyyyMMdd.", e);
DateparseddMMyyyy(String dateStr)
Parsedd m myyyy.
final Date result = ddMMyyyy_DATE_FORMAT.parse(dateStr);
return result;
DateparseDdMmYyyyDate(String date)
parse Dd Mm Yyyy Date
return parseDate(date, DD_MM_YYYY_DATE);
intparseTimeByYYYYMMDDHHMMSS(String str)
parse Time By YYYYMMDDHHMMSS
if (str == null || str.length() != 19)
    return 0;
try {
    return (int) (yyyyMMddHHmmss.parse(str).getTime() / 1000L);
} catch (Exception ex) {
    return 0;
DateparseYYYYMMDD(String s)
parse YYYYMMDD
try {
    return (s == null) ? null : yyyymmdd.parse(s);
} catch (ParseException e) {
    throw new RuntimeException(e);