Here you can find the source of gethttpDate()
public static String gethttpDate()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { /**/*from w w w. ja v a 2s . c o m*/ * Generate an rfc822 date for use in the Date HTTP header. */ public static String gethttpDate() { final String DateFormat = "EEE, dd MMM yyyy HH:mm:ss "; SimpleDateFormat format = new SimpleDateFormat(DateFormat, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); return format.format(new Date()) + "GMT"; } }