Here you can find the source of setTimeToEndofDay(Calendar calendar)
private static void setTimeToEndofDay(Calendar calendar)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { private static void setTimeToEndofDay(Calendar calendar) { calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); calendar.set(Calendar.MILLISECOND, 999); }/*w ww .j a v a 2 s . c om*/ }