Here you can find the source of string2Time(String dateString)
public final static java.sql.Timestamp string2Time(String dateString) throws java.text.ParseException
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Locale; public class Main { public final static java.sql.Timestamp string2Time(String dateString) throws java.text.ParseException { DateFormat dateFormat;// w ww . ja v a 2s.co m dateFormat = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss", Locale.ENGLISH); dateFormat.setLenient(false); java.util.Date timeDate = dateFormat.parse(dateString); java.sql.Timestamp dateTime = new java.sql.Timestamp(timeDate.getTime()); return dateTime; } }