Here you can find the source of yyyyMMddHHmmss2date(String str)
public static Date yyyyMMddHHmmss2date(String str)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private final static String yyyyMMddHHmmss = "yyyy-MM-dd HH:mm:ss"; public static Date yyyyMMddHHmmss2date(String str) { DateFormat format = new SimpleDateFormat(yyyyMMddHHmmss); Date date = new Date(); try {/* ww w . jav a 2 s. c o m*/ date = format.parse(str); } catch (ParseException e) { e.printStackTrace(); } return date; } }