Here you can find the source of parseDateLongFormat(String sDate)
public static Date parseDateLongFormat(String sDate)
//package com.java2s; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String longFormat = "yyyyMMddHHmmss"; public static Date parseDateLongFormat(String sDate) { DateFormat dateFormat = new SimpleDateFormat(longFormat); Date d = null;/* w w w. j ava 2s. co m*/ if ((sDate != null) && (sDate.length() == longFormat.length())) { try { d = dateFormat.parse(sDate); } catch (ParseException ex) { return null; } } return d; } }