Here you can find the source of parse2yyyyMMddHHmmss(String date)
public static Date parse2yyyyMMddHHmmss(String date)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { private static final String yyyyMMddHHmmss = "yyyyMMddHHmmss"; public static Date parse2yyyyMMddHHmmss(String date) { return parseDate(date, yyyyMMddHHmmss); }/*from ww w . ja v a2 s .co m*/ public static Date parseDate(String date, String pattern) { SimpleDateFormat df = new SimpleDateFormat(pattern); df.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); try { return df.parse(date); } catch (ParseException e) { throw new IllegalArgumentException(e); } } }