Here you can find the source of parse(String date)
public static Date parse(String date)
//package com.java2s; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parse(String date, String format) { DateFormat sdf = new SimpleDateFormat(format); try {/* w w w . j av a 2s. com*/ return sdf.parse(date); } catch (ParseException e) { } return null; } public static Date parse(String date) { return parse(date, "yyyy-MM-dd"); } public static Date parse(String date, boolean isDateOnly) { if (isDateOnly) { return parse(date); } else { return parse(date, "yyyy-MM-dd HH:mm"); } } }