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

CalendarparseEuropeanDateAnd12HrsTimeString(String aDateString, String aTimeString)
parse European Date And Hrs Time String
String tempStringToParse;
if (aDateString != null) {
    tempStringToParse = aDateString;
} else {
    tempStringToParse = "01.01.1970";
tempStringToParse += "T";
if (aTimeString.length() < 8) {
...
DateparseEXIFFormat(String dateString)
parse EXIF Format
String datePatterns[] = { "yyyy:MM:dd HH:mm:ss", "yyyy:MM:dd HH:mm", "yyyy-MM-dd HH:mm:ss",
        "yyyy-MM-dd HH:mm", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm" };
for (String datePattern : datePatterns) {
    try {
        DateFormat parser = new SimpleDateFormat(datePattern);
        return parser.parse(dateString);
    } catch (ParseException ex) {
return null;
DateparseExpireField(String timestring)
parse Expire Field
SimpleDateFormat[] sdfs = SIMPLE_DATE_FORMATS.get();
for (SimpleDateFormat sdf : sdfs) {
    Date date = sdf.parse(timestring, new ParsePosition(0));
    if (date != null)
        return date;
return null;
DateparseFormattedTime(String formattedTime)
parse Formatted Time
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
return formatter.parse(formattedTime);
DateparseFTPDate(String dateStr)
parse FTP Date
return FTP_DATE_FORMAT.get().parse(dateStr);
CalendarparseFullDate(String paramName, String dateStr)
Tries to parse full formated date.
Calendar day;
try {
    day = Calendar.getInstance();
    Date date = DATE_FORMAT.parse(dateStr);
    day.setTime(date);
} catch (Exception e) {
    throw new IllegalArgumentException(
            "Unparsable \"" + paramName + "\". Must be in format " + DATE_FORMAT.toPattern(), e);
...
DateparseFullTime(String str)
parse Full Time
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
return format.parse(str);
DateparseGeneralizedTimeAsDate(String generalizedTime)
Parses a generalized time as a date ignoring hour minute seconds.
if (generalizedTime != null) {
    return new SimpleDateFormat("yyyyMMdd").parse(generalizedTime.substring(0, 8));
return null;
DateparseHeaderDate(String headerValue)
Get a header date value as Date
if (headerValue != null && headerValue.length() >= 3) {
    for (String dateFormat : DATE_FORMATS) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat, Locale.US);
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
        try {
            return simpleDateFormat.parse(headerValue);
        } catch (@SuppressWarnings("unused") ParseException ex) {
return null;
StringparseHHMMSS(long time)
parse HHMMSS
try {
    return FORMAT_HHMMSS.format(FORMAT_YYYYMMDDHHMMSSLong.parse(String.valueOf(time)));
} catch (ParseException e) {
    e.printStackTrace();
return null;