Here you can find the source of strToTimestamp(String date)
public static Timestamp strToTimestamp(String date) throws ParseException
//package com.java2s; import java.sql.Timestamp; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Timestamp strToTimestamp(String date) throws ParseException { Date day = strToDate(date); return new Timestamp(day.getTime()); }/*from www . j av a2 s. c om*/ public static Date strToDate(String date) throws ParseException { DateFormat df = new SimpleDateFormat("MM/dd/yyyy"); Date day = df.parse(date); return day; } }