Here you can find the source of endOfDay(final Date date)
public static Date endOfDay(final Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date endOfDay(final Date date) { if (date == null) { return null; }/* w ww . j a v a2 s . c o m*/ final Calendar dateCal = Calendar.getInstance(); dateCal.setLenient(false); dateCal.setTime(date); dateCal.set(Calendar.HOUR_OF_DAY, 23); dateCal.set(Calendar.MINUTE, 59); dateCal.set(Calendar.SECOND, 59); return dateCal.getTime(); } }