Here you can find the source of getMillins(String yyyyMMddHHmmss)
public static long getMillins(String yyyyMMddHHmmss)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { public static long getMillins(String yyyyMMddHHmmss) { long d = 0; try {/*from w w w.ja v a2s . co m*/ java.util.Date date = new java.util.Date(); java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyyMMddhhmmss"); date = formatter.parse(yyyyMMddHHmmss); java.util.Calendar c = java.util.Calendar.getInstance(); c.setTime(date); d = c.getTimeInMillis(); } catch (Exception e) { e.printStackTrace(); } return d; } public static String getMillins(long yyyyMMddHHmmss) { String d = new String(); try { java.util.Date date = new java.util.Date(); date.setTime(yyyyMMddHHmmss); d = new SimpleDateFormat("yyyyMMddHHmmss").format(date); } catch (Exception e) { e.printStackTrace(); } return d; } }