Java Utililty Methods Parse HTTP Date

List of utility methods to do Parse HTTP Date

Description

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

Method

java.util.DateparseHttpDate(String _dateStr)
parse Http Date
if (_dateStr == null)
    return null;
int c1 = _dateStr.lastIndexOf(" ");
if (c1 != -1)
    _dateStr = _dateStr.substring(0, c1).trim();
return parseDate(_dateStr, "EEE, d MMM yyyy HH:mm:ss");
DateparseHttpDate(String dstr)
Parse the http date string.
synchronized (http_parse_lock) {
    if (parse_1123 == null)
        setupParsers();
try {
    return parse_1123.parse(dstr);
} catch (java.text.ParseException pe) {
try {
    return parse_850.parse(dstr);
} catch (java.text.ParseException pe) {
try {
    return parse_asctime.parse(dstr);
} catch (java.text.ParseException pe) {
    throw new IllegalArgumentException(pe.toString());
DateparseHttpDate(String ifModifiedSince)
parse Http Date
if (ifModifiedSince == null) {
    return null;
try {
    return createDateFormat(DATE_FORMAT_RFC1123).parse(ifModifiedSince);
} catch (ParseException e) {
try {
...
longparseHttpDate(String s)
parse Http Date
return getSDF().parse(s).getTime();
DateparseHttpDate(String string)

Parse a String into a Date according to the HTTP/1.1 RFC (Mon, 31 Jan 2000 11:59:00 GMT).

if (string == null)
    return null;
SimpleDateFormat formatter = new SimpleDateFormat(FORMAT_822, LOCALE);
formatter.setTimeZone(TIMEZONE);
try {
    return formatter.parse(string);
} catch (ParseException exception) {
    return null;
...
DateparseHttpDate(String stringValue)
Parse HTTP date.
SimpleDateFormat formatRfc1123 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz");
try {
    return formatRfc1123.parse(stringValue);
} catch (ParseException e) {
    SimpleDateFormat formatRfc1036 = new SimpleDateFormat("EEE, dd-MMM-yy HH:mm:ss zzz");
    try {
        return formatRfc1036.parse(stringValue);
    } catch (ParseException e1) {
...
DateparseHttpDate(String value)
parse Http Date
try {
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.US);
    Date expires = simpleDateFormat.parse(value);
    return expires;
} catch (Exception e) {
    return tryParseDate(value);
DateparseHttpDateFormat(String httpDateFormat)
Can be used to parse http times.
return parseHttpDateFormatToDateTime(httpDateFormat);
DateparseHttpDateString(String s)
parse Http Date String
return new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US).parse(s);