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