Here you can find the source of formatRFC822(Date date, Locale locale)
public static String formatRFC822(Date date, Locale locale)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { public static String formatRFC822(Date date, Locale locale) { SimpleDateFormat dateFormater = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'", locale); dateFormater.setTimeZone(TimeZone.getTimeZone("GMT")); return dateFormater.format(date); }//from ww w. j a va 2 s. co m }