Java Hour Format formatHTTPDate(Date date)

Here you can find the source of formatHTTPDate(Date date)

Description

Formats a date and time in HTTP protocol format.

License

Open Source License

Parameter

Parameter Description
date The date and time.

Return

The formatted date and time.

Declaration


public static String formatHTTPDate(Date date) 

Method Source Code


//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);
    }
}

Related

  1. formatHour(final Date date)
  2. formatHours(Locale locale, double totalhours)
  3. formatHours(long millis)
  4. formatHourTimeHToString(Date srcDate)
  5. formatHttpDate(Date d)
  6. formatHttpDate(Date date)
  7. formatHttpDate(Date date)
  8. formatHttpDate(Date date)
  9. formatHTTPDate(Date pTime)