Here you can find the source of formatHTTPDate(Date date)
Parameter | Description |
---|---|
date | The date and time. |
public static String formatHTTPDate(Date date)
//package com.java2s; /* Please see the license information at the end of this file. */ import java.util.*; import java.text.*; public class Main { /** Date formatter for dates and times in HTTP protocol format e.g. * Wed, 13 Aug 2003 22:03:00 GMT// www . j av a2 s .co m */ static private final SimpleDateFormat httpDateFormatter = new SimpleDateFormat( "EEE, dd MMM yyyy hh:mm:ss 'GMT'"); /** Formats a date and time in HTTP protocol format. * * @param date The date and time. * * @return The formatted date and time. */ public static String formatHTTPDate(Date date) { return httpDateFormatter.format(date); } }