get RFC format Date, EEE, dd MMM yyyy HH:mm:ss 'GMT' - Java java.util

Java examples for java.util:Date Format

Description

get RFC format Date, EEE, dd MMM yyyy HH:mm:ss 'GMT'

Demo Code


//package com.java2s;
import java.text.DateFormatSymbols;
import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.Locale;

public class Main {
    static SimpleDateFormat RFC1123 = new SimpleDateFormat(
            "EEE, dd MMM yyyy HH:mm:ss 'GMT'", new DateFormatSymbols(
                    Locale.ENGLISH));

    public static String getRFC1123(Date date) {
        return RFC1123.format(date);
    }/*  ww w.  j a v  a  2  s.  c o m*/
}

Related Tutorials