Here you can find the source of parseRSSDate(String dateStr)
public static final Date parseRSSDate(String dateStr)
//package com.java2s; /*/*w ww.ja v a2 s. c o m*/ Copyright ? 2013 Mael Le Gu?vel This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details. */ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { private static final String[] RSS_DATE_FORMATS = { "EEE, d MMM yy HH:mm:ss z", "EEE, d MMM yy HH:mm z", "EEE, d MMM yy", "EEE, d MMM yyyy HH:mm:ss z", "EEE, d MMM yyyy HH:mm z", "EEE, d MMM yyyy", "d MMM yy HH:mm z", "d MMM yy HH:mm:ss z", "d MMM yy", "d MMM yyyy HH:mm z", "d MMM yyyy", "d MMM yyyy HH:mm:ss z", "yyyy-MM-dd" }; public static final Date parseRSSDate(String dateStr) { for (String format : RSS_DATE_FORMATS) { DateFormat formatter = new SimpleDateFormat(format, Locale.ROOT); try { Date date = formatter.parse(dateStr); return date; } catch (Exception e) { } } return null; } }