Here you can find the source of stringToDate(String dateString)
public static Date stringToDate(String dateString)
//package com.java2s; //License from project: Open Source License import java.text.*; import java.util.*; public class Main { private static DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); public static Date stringToDate(String dateString) { Date date = null;//from ww w . j ava2 s . c om try { date = df.parse(dateString); } catch (ParseException e) { throw new RuntimeException(e); } return date; } }