Here you can find the source of today()
public static Date today()
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date today() { return day(0); }// w w w . j a v a 2 s. c o m public static Date day(int n) { Calendar c = Calendar.getInstance(); c.set(Calendar.MILLISECOND, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.DAY_OF_MONTH, c.get(Calendar.DAY_OF_MONTH) + n); return c.getTime(); } }