Here you can find the source of convertStringToDate(String dateText)
private static Date convertStringToDate(String dateText)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static Date convertStringToDate(String dateText) { DateFormat dateFormat = new SimpleDateFormat(); try {//w w w . j a v a 2 s. co m return dateFormat.parse(dateText); } catch (ParseException x) { throw new RuntimeException("Unable to parse string [" + dateText + "] into date.", x); } } }