Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static long stringToTime(String dateString, SimpleDateFormat dateFormat) { try { return dateFormat.parse(dateString).getTime(); } catch (ParseException e) { e.printStackTrace(); return 0; } } }