Here you can find the source of convertStringToDate(String dateString, String dateFormat)
public static Date convertStringToDate(String dateString, String dateFormat) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date convertStringToDate(String dateString, String dateFormat) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.parse(dateString); }//from www .j a va2 s . c o m }