Here you can find the source of getRfc822DateStringGMT(Date date)
public static final String getRfc822DateStringGMT(Date date)
//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 SimpleDateFormat RFC_822_ZONE_LESS_FORMAT = new SimpleDateFormat( "EEE', 'dd' 'MMM' 'yyyy' 'HH:mm:ss", Locale.US); public static final String getRfc822DateStringGMT(Date date) { String pattern = RFC_822_ZONE_LESS_FORMAT.toPattern(); SimpleDateFormat format = new SimpleDateFormat(pattern, Locale.US); StringBuilder r = new StringBuilder(); format.setTimeZone(TimeZone.getTimeZone("GMT")); r.append(format.format(date));//w ww . j ava2s .com r.append(" GMT"); return r.toString(); } }