Here you can find the source of getStringToDate(String pValue, String pDateFormat)
public static Date getStringToDate(String pValue, String pDateFormat)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date getStringToDate(String pValue, String pDateFormat) { try {/* w w w .ja v a2s. c o m*/ SimpleDateFormat formatter = new SimpleDateFormat(pDateFormat); formatter.setLenient(false); return formatter.parse(pValue); } catch (Exception e) { return null; } } }