Java Date Format As getDateAsRFC822String(Date date)

Here you can find the source of getDateAsRFC822String(Date date)

Description

RFC822 has strict rules how to format a date.

License

Apache License

Parameter

Parameter Description
date a parameter

Declaration

public static String getDateAsRFC822String(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {
    public static SimpleDateFormat RFC822DATEFORMAT = new SimpleDateFormat("EEE', 'dd' 'MMM' 'yyyy' 'HH:mm:ss' 'Z",
            Locale.US);//w w  w .  ja  va 2  s  .  co  m

    /**
      * RFC822 has strict rules how to format a date. This meets that standard
      * 
      * @param date
      * @return
      */
    public static String getDateAsRFC822String(Date date) {
        return RFC822DATEFORMAT.format(date);
    }
}

Related

  1. formatDDMMYYYY(Date date)
  2. formatddMMyyyy(Date date)
  3. getDateAsISO8601String(Date date)
  4. getDateAsISO8601String(Date date)
  5. getDateAsISOTimestampString(Date timestamp)
  6. getDateYYYYMMDD()
  7. getDateYYYYMMDD(Object yyyymmdd)
  8. getDateYYYYMMDD_HHSSMMNNN()
  9. getDateYyyyMmWithoutDash()