Here you can find the source of Today()
public static Date Today()
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { /**//from ww w.ja v a 2 s . c o m * @return {@link Date} object representing midnight of the current day */ public static Date Today() { return removeTime(new Date()); } /** * Sets the time on the given {@link Date} object to midnight * * @param d * @return */ public static Date removeTime(Date d) { Calendar inst = GregorianCalendar.getInstance(); inst.setTime(d); inst.set(Calendar.HOUR_OF_DAY, 0); inst.set(Calendar.MINUTE, 0); inst.set(Calendar.SECOND, 0); inst.set(Calendar.MILLISECOND, 0); return inst.getTime(); } }