Here you can find the source of getDayStart(Date date)
public static Date getDayStart(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getDayStart(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date);/*from w w w .j a v a 2 s . c o m*/ cal.set(Calendar.HOUR_OF_DAY, 00); cal.set(Calendar.MINUTE, 00); cal.set(Calendar.SECOND, 00); return cal.getTime(); } }