Here you can find the source of strToDate(String _date, String format)
public static Date strToDate(String _date, String format) throws ParseException
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date strToDate(String _date, String format) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.parse(_date); }/* w w w . j av a 2 s . com*/ }