Here you can find the source of convertDateStringToDate(String dateString)
public static Date convertDateStringToDate(String dateString) throws ParseException
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static Date convertDateStringToDate(String dateString) throws ParseException { SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss", Locale.getDefault()); return dateFormat.parse(dateString); }//from w w w. j a va 2 s.co m }