Here you can find the source of getLastTimeOfDay(Calendar calendar)
public static Timestamp getLastTimeOfDay(Calendar calendar)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.util.Calendar; public class Main { public static Timestamp getLastTimeOfDay(Calendar calendar) { calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); return new Timestamp(calendar.getTimeInMillis()); }//w ww . ja v a 2s. c om }