Here you can find the source of formatGmtDate(Date date)
public static String formatGmtDate(Date date)
//package com.java2s; // | Licensed under the Apache License, Version 2.0 (the "License"); import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { private static final String GMT_DATE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss z"; public static String formatGmtDate(Date date) { SimpleDateFormat df = new SimpleDateFormat(GMT_DATE_FORMAT, Locale.US);//from w w w . j a v a 2s . c om df.setTimeZone(TimeZone.getTimeZone("GMT")); return df.format(date); } }