Here you can find the source of parseDate(String dateStr)
public static Date parseDate(String dateStr) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.util.Date; import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormat; public class Main { public static final String DEFAULT_DATE_PATTERN = "YYYY-MM-dd HH:mm:ss"; public static Date parseDate(String dateStr) throws ParseException { return parseDate(dateStr, DEFAULT_DATE_PATTERN); }/*from w w w . j a va2 s .c o m*/ public static Date parseDate(String dateStr, String datePattern) throws ParseException { DateTime dt = DateTimeFormat.forPattern(datePattern).parseDateTime(dateStr); return dt.toDate(); } }