Here you can find the source of getDayEnd(Date obj)
public static Date getDayEnd(Date obj)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date getDayEnd(Date obj) { if (obj == null) { throw new NullPointerException(); }// ww w. ja v a2 s. co m Calendar ca = new GregorianCalendar(); ca.setTime(obj); ca.set(Calendar.HOUR_OF_DAY, 23); ca.set(Calendar.MINUTE, 59); ca.set(Calendar.SECOND, 59); return ca.getTime(); } }