Android Utililty Methods Date String Parse

List of utility methods to do Date String Parse

Description

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

Method

DateparseDate(String dateValue)
Parses a date value.
return parseDate(dateValue, null, null);
DateparseDate(String dateValue)
Parses a date value.
return parseDate(dateValue, null, null);
DateparseDate(String dateValue, String[] dateFormats, Date startDate)
Parses the date value using the given date formats.
if (dateValue == null) {
    throw new IllegalArgumentException("dateValue is null");
if (dateFormats == null) {
    dateFormats = DEFAULT_PATTERNS;
if (startDate == null) {
    startDate = DEFAULT_TWO_DIGIT_YEAR_START;
...
DateparseDate(String dateValue, String[] dateFormats, Date startDate)
Parses the date value using the given date formats.
if (dateValue == null) {
    throw new IllegalArgumentException("dateValue is null");
if (dateFormats == null) {
    dateFormats = DEFAULT_PATTERNS;
if (startDate == null) {
    startDate = DEFAULT_TWO_DIGIT_YEAR_START;
...
DateparseDate(String str)
parse Date
return parseDate(str, parsePatterns[1]);
DateparseDate(String str, String parsePattern)
parse Date
SimpleDateFormat format = new SimpleDateFormat(parsePattern);
Date date = null;
try {
    date = format.parse(str);
} catch (ParseException e) {
    e.printStackTrace();
return date;
...
DateparseDate(String str, String... parsePatterns)

Parses a string representing a date by trying a variety of different parsers.

The parse will try each parse pattern in turn.

return parseDateWithLeniency(str, parsePatterns, true);
DateparseDate(String ts)
parse Date
SimpleDateFormat dateformat = new SimpleDateFormat(
        DEFAULT_TIME_DATE_FORMAT);
try {
    return dateformat.parse(ts);
} catch (ParseException e) {
    return null;
DateparseDate(final String dateValue, String[] dateFormats)
Parses the date value using the given date formats.
return parseDate(dateValue, dateFormats, null);
DateparseDate(final String dateValue, String[] dateFormats)
Parses the date value using the given date formats.
return parseDate(dateValue, dateFormats, null);