Here you can find the source of stringToDate(String s)
public static Date stringToDate(String s) throws ParseException
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String DATE_FORMAT = "yyyy/MM/dd"; public static Date stringToDate(String s) throws ParseException { SimpleDateFormat sd = new SimpleDateFormat(DATE_FORMAT); Date date = sd.parse(s);/*from www. ja v a 2 s. c om*/ return date; } }