Here you can find the source of startOfDay(final Date date)
public static Calendar startOfDay(final Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static Calendar startOfDay(final Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date);// w ww. j a va 2 s.c om setStartOfDay(calendar); return calendar; } public static void setStartOfDay(final Calendar calendar) { calendar.set(Calendar.HOUR, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); } }