Here you can find the source of getDayEndCalendar(Calendar cal)
public static Calendar getDayEndCalendar(Calendar cal)
//package com.java2s; /*/*from www .j a v a2 s . c o m*/ * @ (#) CalendarUtils.java * * Copyright (c) 2010 ClickDiagnostics Inc. All Rights Reserved. This software is the * confidential and proprietary information of ClickDiagnostics ("Confidential * Information"). You shall not disclose such Confidential Information and shall * use it only in accordance with the terms of the license agreement you entered * into with ClickDiagnostics. */ import java.util.Calendar; import java.util.Date; public class Main { public static Calendar getDayEndCalendar(Calendar cal) { Date date = cal.getTime(); Calendar endCalendar = Calendar.getInstance(); endCalendar.setTime(date); // set the hour min sec endCalendar.set(Calendar.HOUR, 11); endCalendar.set(Calendar.HOUR_OF_DAY, 23); endCalendar.set(Calendar.MINUTE, 59); endCalendar.set(Calendar.SECOND, 59); // return cal return endCalendar; } }