Here you can find the source of getDateFromString(String dateString)
public static Date getDateFromString(String dateString)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static String dateFormatString = "MM/dd/yyyy HH:mm:ss"; public static Date getDateFromString(String dateString) { SimpleDateFormat format = new SimpleDateFormat(dateFormatString); try {/*from w ww.j a v a 2s .c o m*/ Date date = format.parse(dateString); return date; } catch (Exception e) { throw new RuntimeException(e); } } }