Here you can find the source of getGMT(Date date)
public static String getGMT(Date date)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; public class Main { private static DateFormat FORMAT = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", Locale.ENGLISH); public static String getGMT(Date date) { FORMAT.setTimeZone(TimeZone.getTimeZone("GMT")); String dateString = FORMAT.format(date); return dateString; }/*from w ww . ja v a2 s .c om*/ }