Here you can find the source of endOfDay(Date value)
Parameter | Description |
---|---|
value | Specified time |
public static Date endOfDay(Date value)
//package com.java2s; //License from project: LGPL import java.util.Date; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { /**// w ww . ja v a 2 s . c om * Return the end of a day containing a specified time * @param value Specified time * @return Start of day */ public static Date endOfDay(Date value) { Calendar working = new GregorianCalendar(); working.setTime(value); working.set(Calendar.HOUR_OF_DAY, 23); working.set(Calendar.MINUTE, 59); working.set(Calendar.SECOND, 59); working.set(Calendar.MILLISECOND, 999); return working.getTime(); } }