Here you can find the source of convertEndOfDay(Calendar cal)
public static Calendar convertEndOfDay(Calendar cal)
//package com.java2s; //License from project: LGPL import java.util.Calendar; public class Main { public static Calendar convertEndOfDay(Calendar cal) { Calendar outCal = Calendar.getInstance(); outCal.setTimeInMillis(0);//from w ww. j av a 2s. c o m outCal.set(Calendar.YEAR, cal.get(Calendar.YEAR)); outCal.set(Calendar.MONTH, cal.get(Calendar.MONTH)); outCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH)); outCal.set(Calendar.HOUR, 23); outCal.set(Calendar.MINUTE, 59); outCal.set(Calendar.SECOND, 59); outCal.set(Calendar.MILLISECOND, 999); return outCal; } }