Java Utililty Methods Date RFC Format

List of utility methods to do Date RFC Format

Description

The list of methods to do Date RFC Format are organized into topic(s).

Method

StringgetRFC822String(Date date)
get RFC String
return (RFC822.format(date));
StringmakeDateRFC2822(Date date)
make Date RFC
SimpleDateFormat df = new SimpleDateFormat("EEE', 'dd' 'MMM' 'yyyy' 'HH:mm:ss' 'Z", Locale.US);
return df.format(date);
StringrenderDateAsRFC822String(Date date)
render Date As RFC String
if (date == null) {
    return null;
return RFC822DATEFORMAT.format(date);
DateresolvedDateRFC822(String pString)
resolved Date RFC
Date lDate = null;
String[] lDateFormats = { "EEE, dd MMM yyyy kk:mm:ss z", "EEE, MMM dd yyyy kk:mm:ss z" };
if (pString != null && !"".equals(pString)) {
    SimpleDateFormat simpleFormatter = (SimpleDateFormat) formatter;
    for (int i = 0; i < lDateFormats.length; i++) {
        String lFormat = lDateFormats[i];
        simpleFormatter.applyPattern(lFormat);
        try {
...
Stringrfc1123Date(Date d)
Return the RFC1123 string representation of a date.
if (d == null)
    return null;
SimpleDateFormat asGMTrfc1123 = new SimpleDateFormat(PATTERN_RFC1123); 
asGMTrfc1123.setTimeZone(TimeZone.getTimeZone("GMT"));
return asGMTrfc1123.format(d);
Stringrfc1123Format(Date date)
rfc Format
return RFC_1123.get().format(date);
Stringrfc2822(Date date)
rfc
String pattern = "EEE, dd MMM yyyy HH:mm:ss Z"; 
SimpleDateFormat format = new SimpleDateFormat(pattern);
return format.format(date);
Stringrfc822(Date date)
rfc
DateFormat dateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", Locale.US);
TimeZone zone = new SimpleTimeZone(8, "GMT");
dateFormat.setTimeZone(zone);
return dateFormat.format(date);
Stringrfc822Date(Date date)
rfc Date
final String DateFormat = "EEE, dd MMM yyyy HH:mm:ss ";
SimpleDateFormat format;
format = new SimpleDateFormat(DateFormat, Locale.US);
format.setTimeZone(TimeZone.getTimeZone("GMT"));
return format.format(date) + "GMT";
Stringrfc822Date(final Date val)
Turn Date into "???"
synchronized (rfc822GMTFormat) {
    return rfc822GMTFormat.format(val);