Here you can find the source of getLongMillis(String date)
public static long getLongMillis(String date)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { private static final SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static long getLongMillis(String date) { try {/*from ww w.j av a2 s. com*/ return dateTimeFormat.parse(date).getTime(); } catch (ParseException e) { return 0; } } }