Here you can find the source of rfc822Date(Date date)
public static String rfc822Date(Date date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { public static String rfc822Date(Date date) { // Convert the expiration date to rfc822 format. final String DateFormat = "EEE, dd MMM yyyy HH:mm:ss "; SimpleDateFormat format;/*w w w . j a v a 2s . co m*/ format = new SimpleDateFormat(DateFormat, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); return format.format(date) + "GMT"; } }