Here you can find the source of parse(String dateStr)
public static Date parse(String dateStr)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String STANDARD_DATE_PATTERN = "yyyy-MM-dd"; public static Date parse(String dateStr) { return parse(dateStr, STANDARD_DATE_PATTERN); }/* w ww . j av a2 s. c o m*/ public static Date parse(String dateStr, String pattern) { try { DateFormat format = new SimpleDateFormat(pattern); return format.parse(dateStr); } catch (ParseException e) { e.printStackTrace(); } return null; } }