Here you can find the source of getRfc1123DateFormat()
DateFormat
for RFC1123 compliant dates.
public static DateFormat getRfc1123DateFormat()
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Locale; import java.util.TimeZone; public class Main { /**//w ww. j av a 2 s .c o m * Creates a new instance of a <code>DateFormat</code> for RFC1123 compliant dates. <br> * Should be stored for later use but be aware that this DateFormat is not Thread-safe! <br> * If you have to deal with dates in this format with JavaScript, it's easy, because the JavaScript Date object has * a constructor for strings formatted this way. * * @return a new instance */ public static DateFormat getRfc1123DateFormat() { final DateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH); format.setLenient(false); format.setTimeZone(TimeZone.getTimeZone("UTC")); return format; } }