Here you can find the source of getDayTime(Date date, int hour, int minute, int second)
public static Date getDayTime(Date date, int hour, int minute, int second)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date getDayTime(Date date, int hour, int minute, int second) { GregorianCalendar gc = new GregorianCalendar(); gc.setTime(date);/* w ww . jav a 2 s.c o m*/ gc.set(Calendar.HOUR_OF_DAY, hour); gc.set(Calendar.MINUTE, minute); gc.set(Calendar.SECOND, second); return gc.getTime(); } }