Here you can find the source of parseDate(String dateString)
public static Date parseDate(String dateString)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { protected static final String _listFormat[] = { "", "", "" }; public static Date parseDate(String dateString) { return parseDate(dateString, _listFormat); }/*ww w .jav a2 s . co m*/ public static Date parseDate(String dateString, String format) { String listFormat[] = new String[1]; listFormat[0] = format; return parseDate(dateString, listFormat); } public static Date parseDate(String dateString, String[] formats) { Date date = null; for (String format : formats) { SimpleDateFormat dateFormat = new SimpleDateFormat(format); try { date = dateFormat.parse(dateString); break; // i.e. don't try further. } catch (ParseException e) { } } return date; } }