Here you can find the source of getTimestampFromString(String id)
public static long getTimestampFromString(String id) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.text.ParseException; public class Main { public static long getTimestampFromString(String id) throws ParseException { String a[] = id.split("-"); return new SimpleDateFormat("yyyyMMddHHmmss").parse(a[1]).getTime() / 1000; }/* w ww . jav a 2s.c om*/ }