Here you can find the source of setStartTime(Date date)
public static Date setStartTime(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date setStartTime(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date);/*from w ww . j av a 2 s . c o m*/ cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTime(); } public static Date setTime(Date date, int hour, int mins, int secs) { Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.set(Calendar.HOUR_OF_DAY, hour); cal.set(Calendar.MINUTE, mins); cal.set(Calendar.SECOND, secs); cal.set(Calendar.MILLISECOND, 0); return cal.getTime(); } }