Here you can find the source of getDateWithSpecifiedHourAndMinute(Date targetDate, int hour, int minute)
public static Timestamp getDateWithSpecifiedHourAndMinute(Date targetDate, int hour, int minute)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.util.Calendar; import java.util.Date; public class Main { public static Timestamp getDateWithSpecifiedHourAndMinute(Date targetDate, int hour, int minute) { Calendar c = Calendar.getInstance(); c.setTime(targetDate);/*w w w. j a va 2 s . c om*/ c.set(Calendar.HOUR_OF_DAY, hour); c.set(Calendar.MINUTE, minute); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); return new Timestamp(c.getTimeInMillis()); } }