Here you can find the source of convertStringToDate(String strDate, String parseFormat)
public static Date convertStringToDate(String strDate, String parseFormat)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date convertStringToDate(String strDate, String parseFormat) { try {//from ww w. ja v a2 s . c om return new SimpleDateFormat(parseFormat).parse(strDate); } catch (Exception e) { e.printStackTrace(); return null; } } }