Here you can find the source of parseDate(String string)
public static Date parseDate(String string)
//package com.java2s; //License from project: Apache License import java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.text.ParseException; public class Main { public static Date parseDate(String string) { Date result = new Date(); DateFormat format = new SimpleDateFormat("M/d/y h:m a"); try {/*from ww w .java 2 s .co m*/ result = format.parse(string); } catch (ParseException e) { e.printStackTrace(); } return result; } }