Here you can find the source of getEndOfDay(final Date date, final TimeZone timeZone)
public static Date getEndOfDay(final Date date, final TimeZone timeZone)
//package com.java2s; // ProjectForge is dual-licensed. import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static Date getEndOfDay(final Date date, final TimeZone timeZone) { final Calendar cal = Calendar.getInstance(timeZone); cal.setTime(date);// w w w. j a v a 2s. com cal.set(Calendar.HOUR_OF_DAY, 23); cal.set(Calendar.MINUTE, 59); cal.set(Calendar.SECOND, 59); cal.set(Calendar.MILLISECOND, 999); return cal.getTime(); } }