Here you can find the source of parseTimestamp(String sDate, String sFormat)
public static Timestamp parseTimestamp(String sDate, String sFormat) throws ParseException
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.text.ParseException; public class Main { public static Timestamp parseTimestamp(String sDate, String sFormat) throws ParseException { java.text.SimpleDateFormat formatter = null; java.util.Date utildate = null; formatter = new java.text.SimpleDateFormat(sFormat); utildate = formatter.parse(sDate); java.sql.Timestamp tsdate = new java.sql.Timestamp(utildate.getTime()); return tsdate; }/*from www .j a v a 2 s . com*/ }