Here you can find the source of strToDate(String strDate)
public static Date strToDate(String strDate)
//package com.java2s; //License from project: Apache License import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String FORMAT_YMD = "yyyy-MM-dd"; public static Date strToDate(String strDate) { ParsePosition pos = new ParsePosition(0); return new SimpleDateFormat(FORMAT_YMD).parse(strDate, pos); }/*from w ww . j a va 2s. c om*/ }