Here you can find the source of parseRFC822(String str)
public static Date parseRFC822(String str)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat rfc822DateFormats[] = new SimpleDateFormat[] { new SimpleDateFormat("EEE, d MMM yy HH:mm:ss z"), new SimpleDateFormat("EEE, d MMM yy HH:mm z"), new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z"), new SimpleDateFormat("EEE, d MMM yyyy HH:mm z"), new SimpleDateFormat("d MMM yy HH:mm z"), new SimpleDateFormat("d MMM yy HH:mm:ss z"), new SimpleDateFormat("d MMM yyyy HH:mm z"), new SimpleDateFormat("d MMM yyyy HH:mm:ss z"), }; public static Date parseRFC822(String str) { for (SimpleDateFormat rfc822DateFormat : rfc822DateFormats) { try { Date theDate = rfc822DateFormat.parse(str); if (theDate instanceof Date) return theDate; } catch (ParseException e) { }//www . j a v a2 s . c om } return null; } }