Here you can find the source of parseHttpDate(String s)
public static long parseHttpDate(String s) throws ParseException
//package com.java2s; /**/* w ww .j a v a 2 s . c om*/ * Copyright (c) 2013-2017, Kenneth Leung. All rights reserved. * The use and distribution terms for this software are covered by the * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) * which can be found in the file epl-v10.html at the root of this distribution. * By using this software in any fashion, you are agreeing to be bound by * the terms of this license. * You must not remove this notice, or any other, from this software. */ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Locale; import java.util.TimeZone; public class Main { private static ThreadLocal<SimpleDateFormat> _fmt = new ThreadLocal<SimpleDateFormat>() { public SimpleDateFormat initialValue() { SimpleDateFormat f = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); f.setTimeZone(TimeZone.getTimeZone("GMT")); return f; } }; /** */ public static long parseHttpDate(String s, long defaultValue) { try { return parseHttpDate(s); } catch (ParseException e) { } return defaultValue; } /** */ public static long parseHttpDate(String s) throws ParseException { return getSDF().parse(s).getTime(); } public static SimpleDateFormat getSDF() { return _fmt.get(); } }