Java tutorial
//package com.java2s; import java.sql.Timestamp; public class Main { public static long getTimestamp(String time) { time = time + ":00"; Timestamp ts = new Timestamp(System.currentTimeMillis()); try { ts = Timestamp.valueOf(time); } catch (Exception e) { e.printStackTrace(); } return ts.getTime(); } }