Here you can find the source of parseDate(String s)
public static Date parseDate(String s) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { static DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static Date parseDate(String s) throws ParseException { if (s == null || s.length() == 0) { return null; } else {//ww w. j a v a 2s . co m if (s.length() == 10) { s += " 00:00:00"; } return df.parse(s); } } }