Here you can find the source of formatRFC822(Date date)
public static synchronized String formatRFC822(Date date)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { protected static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); protected static DateFormat rfc822DateFormat = new SimpleDateFormat("EEE, dd MMM yyyy kk:mm:ss zzz"); public static synchronized String formatRFC822(Date date) { return rfc822DateFormat.format(date); }/* w w w. j a v a2 s . co m*/ public static synchronized String format(Date date) { return dateFormat.format(date); } }