Here you can find the source of newCalendarForDay(Date date)
public static Calendar newCalendarForDay(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 newCalendarForDay(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date);/*from w w w .j av a 2 s. c o m*/ cal.set(Calendar.HOUR, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal; } }