Here you can find the source of StringToDate(String date)
public static Date StringToDate(String date)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; public class Main { private final static SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd"); public static Date StringToDate(String date) { try {//from w w w. ja v a2 s . co m return yyyyMMdd.parse(date); } catch (ParseException e) { } return new Date(); } }