Here you can find the source of parseDateWithFormat(String date, SimpleDateFormat dateFormat, Date defaultDate)
public static Date parseDateWithFormat(String date, SimpleDateFormat dateFormat, Date defaultDate)
//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 parseDateWithFormat(String date, SimpleDateFormat dateFormat, Date defaultDate) { try {/*from w w w .j ava 2 s . c o m*/ return dateFormat.parse(date); } catch (ParseException e) { e.printStackTrace(); } return defaultDate; } }