Here you can find the source of StrToDate(String dateFormat)
public static Date StrToDate(String dateFormat)
//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 StrToDate(String dateFormat) { SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a"); try {//from www.j a v a2s .c om return formatter.parse(dateFormat); } catch (ParseException e) { e.printStackTrace(); } return null; } }