Here you can find the source of getRFC822Date()
public static String getRFC822Date()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String MAIL_FORMAT_STR = "EEE, d MMM yyyy HH:mm:ss Z"; /**//from w w w .j av a 2s . c o m * Get the RFC822-compliant representation of the current time * * @return the formatted String */ public static String getRFC822Date() { return getRFC822Date(new Date()); } /** * Get the RFC822-compliant representation of the given Date * * @param d * the date * @return the formatted String */ public static String getRFC822Date(Date d) { return new SimpleDateFormat(MAIL_FORMAT_STR).format(d); } }