Here you can find the source of getStartOfDay(Date date)
public static Date getStartOfDay(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date getStartOfDay(Date date) { Calendar cal = new GregorianCalendar(); cal.setTime(date);//from w ww .j a va2 s.c o m cal.set(Calendar.HOUR, -12); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); date = cal.getTime(); return date; } }