Here you can find the source of getTimestamp(String dateStr)
public static Timestamp getTimestamp(String dateStr)
//package com.java2s; import java.sql.Timestamp; import java.text.SimpleDateFormat; public class Main { public static Timestamp getTimestamp(String dateStr) { try {//w w w . j ava 2 s. co m SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy kk:mm:ss"); Timestamp date = new Timestamp(dateFormat.parse(dateStr).getTime()); return date; } catch (Exception ex) { System.out.println("Error: " + ex.toString()); return null; } } }