Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; public class Main { public static String getTimestampDate(String dateString, String formatString) { SimpleDateFormat format = new SimpleDateFormat(formatString); try { return String.valueOf(format.parse(dateString).getTime()); } catch (Exception e) { return ""; } } }