Here you can find the source of parseDateAndGetLong(String date)
public static String parseDateAndGetLong(String date)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static final String DEFAULT_DATE_FORMAT = "dd-MM-yyyy HH:mm:ss"; public static String parseDateAndGetLong(String date) { DateFormat format = new SimpleDateFormat(DEFAULT_DATE_FORMAT); try {/*from www.ja v a 2s. co m*/ return String.valueOf(format.parse(date).getTime()); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return ""; } }