Here you can find the source of getCurrentDayBegin()
public static Date getCurrentDayBegin()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.*; public class Main { private final static SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static Date getCurrentDayBegin() { Calendar calendar = new GregorianCalendar(); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); return calendar.getTime(); }// w w w . j av a 2s .com public static String getTime() { return sdfTime.format(new Date()); } }