Here you can find the source of convertDateFromString(String inputDateString)
public static Date convertDateFromString(String inputDateString) throws ParseException
//package com.java2s; //License from project: Open Source License import java.sql.Date; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static String DEFAULT_DATE_FORMAT = "dd-mm-yyyy"; public static Date convertDateFromString(String inputDateString) throws ParseException { DateFormat sf = new SimpleDateFormat(DEFAULT_DATE_FORMAT); return new Date(sf.parse(inputDateString).getTime()); }/*from w w w . ja v a 2 s . co m*/ }