Here you can find the source of setTimeToEndOfDay(Date date)
public static Date setTimeToEndOfDay(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date setTimeToEndOfDay(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date);// w ww .ja va 2 s . c o m c.set(Calendar.HOUR_OF_DAY, 23); c.set(Calendar.MINUTE, 59); c.set(Calendar.SECOND, 59); c.set(Calendar.MILLISECOND, 999); return c.getTime(); } }