Here you can find the source of stringDateToDate(String str)
public static Date stringDateToDate(String str) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.util.Date; public class Main { public static Date stringDateToDate(String str) throws ParseException { java.text.DateFormat format = new java.text.SimpleDateFormat("yyyyMMdd"); return format.parse(str); }/* ww w . j a v a 2s.c om*/ }