Here you can find the source of clearTime(Calendar cal)
public static void clearTime(Calendar cal)
//package com.java2s; // The MIT License (MIT) import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static java.util.Date clearTime(java.util.Date d) { Calendar cal = new GregorianCalendar(); cal.setTime(d);//from w w w. j a va 2 s. co m clearTime(cal); return cal.getTime(); } public static void clearTime(Calendar cal) { cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); } }