Here you can find the source of getDateTimeRtnTime(Date date, String time)
public static Timestamp getDateTimeRtnTime(Date date, String time)
//package com.java2s; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Timestamp getDateTimeRtnTime(Date date, String time) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Timestamp timeStamp = null; sdf.setLenient(false);//www .ja v a2 s .c o m try { String dateStr = sdf.format(date); timeStamp = Timestamp.valueOf(dateStr + " " + time); } catch (Exception e) { } return timeStamp; } }