Java Utililty Methods Parse Date Pattern YYYY

List of utility methods to do Parse Date Pattern YYYY

Description

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

Method

Dateparse(String param)
Parse a datetime string.
Date date = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
    date = sdf.parse(param);
} catch (ParseException e) {
return date;
Dateparse(String s)
parse
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
return dateFormat.parse(s);
Dateparse(String s)
parse
Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
calendar.clear();
String dateWithoutTZ = s.substring(NUMBER_0, NUMBER_23);
String timeZone = s.substring(NUMBER_23, NUMBER_29);
Calendar calWithoutTZ = new GregorianCalendar();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S");
Date date = df.parse(dateWithoutTZ);
calWithoutTZ.setTimeInMillis(date.getTime());
...
Dateparse(String s)
Return a date object from a given string.
if (s == null) {
    return new Date();
Date date = useDefaultFormatter(s);
int i = 0;
while (date == null && i < DATE_FORMATS.length) {
    date = getDate(s, DATE_FORMATS[i++]);
return date == null ? new Date() : date;
Dateparse(String s)
parse
return parse(s, DEFAULT_PATTERN);
Dateparse(String s)
Parses a date from string.
return DATE_FORMAT.get().parse(s);
Calendarparse(String s)
Parses the give string to a Calendar object in the following steps: 1.
Calendar cal;
try {
    cal = valueOf(s);
    if (cal != null)
        return cal;
} catch (Exception ex) {
cal = parse(s, Locale.getDefault());
...
intparse(String s)
start="20100110175500 +0100"
return (int) (df.parse(s).getTime() / 1000 / 60);
Dateparse(String s, String formatPattern)
parse
try {
    return new SimpleDateFormat(formatPattern).parse(s);
} catch (ParseException e) {
    throw new RuntimeException("could not parse date: " + s + " LEGACY_FORMAT = "
            + new SimpleDateFormat(LEGACY_FORMAT).toPattern(), e);
Dateparse(String source)
parse
Date date = null;
try {
    DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_GMT, local);
    dateFormat.setTimeZone(timeZone);
    date = dateFormat.parse(source);
} catch (Exception e) {
    e.printStackTrace();
return date;