Here you can find the source of todayCalendar()
public static Calendar todayCalendar()
//package com.java2s; // The MIT License (MIT) import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static Calendar todayCalendar() { Calendar cal = new GregorianCalendar(); clearTime(cal);/*from w ww . ja v a2 s . c o m*/ return cal; } public static java.util.Date clearTime(java.util.Date d) { Calendar cal = new GregorianCalendar(); cal.setTime(d); 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); } }