Here you can find the source of parseTimestamp(String src, String pattern)
public static Timestamp parseTimestamp(String src, String pattern) throws ParseException
//package com.java2s; //License from project: LGPL import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Timestamp parseTimestamp(String src, String pattern) throws ParseException { Date date = parseDate(src, pattern); return new Timestamp(date.getTime()); }// w w w.ja v a2 s . co m public static Date parseDate(String src, String pattern) throws ParseException { return getSDFormat(pattern).parse(src); } private static SimpleDateFormat getSDFormat(String pattern) { return new SimpleDateFormat(pattern); } }