Here you can find the source of getCleanDay(Calendar c)
private static Date getCleanDay(Calendar c)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getCleanDay(Date day) { return getCleanDay(getCalendar(day)); }/*from w w w . j a va 2 s . com*/ private static Date getCleanDay(Calendar c) { c.set(11, 0); c.clear(12); c.clear(13); c.clear(14); return c.getTime(); } public static Calendar getCalendar(Date day) { Calendar c = Calendar.getInstance(); if (day != null) c.setTime(day); return c; } }