Here you can find the source of parseHttpDate(String value)
public static Date parseHttpDate(String value)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.*; public class Main { public static Date parseHttpDate(String value) { try {/*w w w. j ava2s. co m*/ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.US); Date expires = simpleDateFormat.parse(value); return expires; } catch (Exception e) { return tryParseDate(value); } } @SuppressWarnings("deprecation") public static Date tryParseDate(String value) { try { return new Date(Date.parse(value)); } catch (Exception e) { return new Date(); } } @SuppressWarnings("deprecation") public static Date tryParseDate(String value, Date defaultValue) { try { return new Date(Date.parse(value)); } catch (Exception e) { return defaultValue; } } }