Here you can find the source of parseDate(String date, String format)
public static Date parseDate(String date, String format) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDate(String date) throws ParseException { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); return df.parse(date); }//from ww w . jav a 2 s .com public static Date parseDate(String date, String format) throws ParseException { SimpleDateFormat df = new SimpleDateFormat(format); return df.parse(date); } }