Java Hour Format formatHttpDate(Date date)

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

Description

Formats given Date as RFC1123 date.

License

Artistic License

Parameter

Parameter Description
date date to format

Declaration

public static String formatHttpDate(Date date) 

Method Source Code


//package com.java2s;
//License from project: Artistic License 

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import java.util.Locale;

public class Main {
    /** RFC1123 date format */
    private static final DateFormat httpDateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z",
            Locale.ENGLISH);/*from   ww w.  j a  v  a2s . c  o  m*/

    /**
     * Formats given {@link Date} as RFC1123 date.
     * 
     * @param date date to format
     */
    public static String formatHttpDate(Date date) {
        return httpDateFormat.format(date);
    }
}

Related

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