Java HTTP Date getHttpDateFormatter()

Here you can find the source of getHttpDateFormatter()

Description

get Http Date Formatter

License

Apache License

Declaration

public static SimpleDateFormat getHttpDateFormatter() 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private static ThreadLocal<SimpleDateFormat> httpFormatter = new ThreadLocal<SimpleDateFormat>();

    public static SimpleDateFormat getHttpDateFormatter() {
        if (httpFormatter.get() == null) {
            httpFormatter.set(new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US));
            httpFormatter.get().setTimeZone(TimeZone.getTimeZone("GMT"));
        }/*  w w  w.j  av  a 2 s.co  m*/
        return httpFormatter.get();
    }
}

Related

  1. getHttpDate(String date)
  2. getHttpDate(String value)
  3. getHttpDateFormat()
  4. getHttpDateFormat(String dataFormat, Locale defaultLocale, String defaultTimeZone)
  5. GetHTTPDateFormater()
  6. getHttpDateString(Date date)