Here you can find the source of parseDate(String dateStr)
public static Date parseDate(String dateStr)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDate(String dateStr, String pattern) { SimpleDateFormat sdf = new SimpleDateFormat(pattern); try {/*from w w w . j a v a2 s. com*/ return sdf.parse(dateStr); } catch (Exception e) { return null; } } public static Date parseDate(String dateStr) { return parseDate(dateStr, "yyyy-MM-dd"); } }