Here you can find the source of today()
public static Date today()
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { /**//from w w w. ja v a 2s.c om * Milliseconds=14 * */ public static final int MILLISECOND = Calendar.MILLISECOND; /** * Seconds=13 * */ public static final int SECOND = Calendar.SECOND; /** * Minute=12 * */ public static final int MINUTE = Calendar.MINUTE; /** * Hour=11 * */ public static final int HOUR = Calendar.HOUR_OF_DAY; public static Date today() { final Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); // zero time (hour, minutes, seconds, milliseconds) calendar.set(Calendar.HOUR, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTime(); } }