Here you can find the source of dateStringToTimestamp(String dateStr)
public static Timestamp dateStringToTimestamp(String dateStr)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; public class Main { public static Timestamp dateStringToTimestamp(String dateStr) { Timestamp ts = new Timestamp(System.currentTimeMillis()); dateStr += " 00:00:00"; try {/* w w w .jav a 2s. co m*/ ts = Timestamp.valueOf(dateStr); } catch (Exception e) { e.printStackTrace(); } return ts; } }