Here you can find the source of dayEnd(final Date date)
public static Date dayEnd(final Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date dayEnd(final Date date) { Calendar c = Calendar.getInstance(); c.setTime(date);/* ww w.ja va 2 s . co 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(); } }