Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Locale; public class Main { public static long getLongForPresentDate(String date) { SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy", Locale.US); long time = 0; try { time = sdf.parse(date).getTime(); } catch (ParseException e) { e.printStackTrace(); } return time; } }