Here you can find the source of getEndTimeOfDay(Date date)
public static Date getEndTimeOfDay(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getEndTimeOfDay(Date date) { Calendar calender = Calendar.getInstance(); calender.setTime(date);//w w w. j a v a 2 s .c om setEndTimeOfDay(calender); return calender.getTime(); } private static void setEndTimeOfDay(Calendar calender) { calender.set(Calendar.HOUR_OF_DAY, calender.getActualMaximum(Calendar.HOUR_OF_DAY)); calender.set(Calendar.MINUTE, calender.getActualMaximum(Calendar.MINUTE)); calender.set(Calendar.SECOND, calender.getActualMaximum(Calendar.SECOND)); calender.set(Calendar.MILLISECOND, calender.getActualMaximum(Calendar.MILLISECOND)); } }