Here you can find the source of endOfDayDate(Date date)
static public Date endOfDayDate(Date date)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { static public Date endOfDayDate(Date date) { Calendar now = Calendar.getInstance(); now.setTime(date);//from w ww . j a v a2s . com now.set(Calendar.HOUR_OF_DAY, 23); now.set(Calendar.MINUTE, 59); now.set(Calendar.SECOND, 59); now.set(Calendar.MILLISECOND, 999); return now.getTime(); } }