Here you can find the source of today()
public static Date today()
//package com.java2s; //License from project: Apache License import java.util.Date; public class Main { public static Date today() { java.util.Calendar now = java.util.Calendar.getInstance(); //Month in java.util.Calendar is 0-based, so add 1 to simulate .NET: return dateForYMDHMS(now.get(java.util.Calendar.YEAR), now.get(java.util.Calendar.MONTH) + 1, now.get(java.util.Calendar.DATE), 0, 0, 0); }/*from w w w .ja va 2s . c om*/ public static Date dateForYMDHMS(int year, int month, int day, int hour, int minute, int second) { java.util.Calendar cal = java.util.Calendar.getInstance(); cal.clear(); //Month in java.util.Calendar is 0-based, so subtract 1: cal.set(year, month - 1, day, hour, minute, second); return cal.getTime(); } }