Here you can find the source of parseLongFormat(String dateString)
public static Date parseLongFormat(String dateString)
import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main{ public static final String LOCAL_LONG_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; public static Date parseLongFormat(String dateString) { return parse(dateString, LOCAL_LONG_DATE_FORMAT); }// ww w . j a va2 s. com public static Date parse(String dateString, String dateFormat) { if (StringUtil.isEmpty(dateString) || StringUtil.isEmpty(dateFormat)) { return null; } SimpleDateFormat format = new SimpleDateFormat(dateFormat, Locale.ENGLISH); Date date = null; try { date = format.parse(dateString); } catch (Exception ex) { } return date; } }