Here you can find the source of convertString2TimeStamp(String dateString)
public static Timestamp convertString2TimeStamp(String dateString) throws ParseException
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static Timestamp convertString2TimeStamp(String dateString) throws ParseException { return new Timestamp(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse(dateString).getTime()); }// w w w. j av a 2 s. c o m }