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

Java examples for java.util:Date Parse

Description

parse RFC in format 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 Date parseRFC1123(String str) throws Exception {
        return RFC1123.parse(str);
    }/* w ww  .  ja  v a 2 s  .c om*/
}

Related Tutorials