Here you can find the source of formatGMT(Date date)
public static String formatGMT(Date date) throws Exception
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static final TimeZone TIME_ZONE_GMT = TimeZone.getTimeZone("GMT"); public static final String DATE_TIME_PATTERN = "yyyyMMdd-HHmm"; public static String formatGMT(Date date) throws Exception { assert (date != null); SimpleDateFormat format = new SimpleDateFormat(DATE_TIME_PATTERN); format.setTimeZone(TIME_ZONE_GMT); return format.format(date); }/*from w w w. j a v a 2 s . co m*/ }