java date and time to timestamp code example
Example 1: localdate to timestamp in java
Timestamp timestamp = Timestamp.valueOf(localDate.atStartOfDay());
Example 2: date to timestamp java
All you need to do is change the string within the java.text.SimpleDateFormat constructor to: "MM-dd-yyyy HH:mm:ss".
Just use the appropriate letters to build the above string to match your input date.