Java Calendar Day getDayEndCalendar(Calendar cal)

Here you can find the source of getDayEndCalendar(Calendar cal)

Description

get Day End Calendar

License

Open Source License

Declaration

public static Calendar getDayEndCalendar(Calendar cal) 

Method Source Code

//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;
    }
}

Related

  1. getCleanDay(Calendar c)
  2. getCurDay(Calendar calendar)
  3. getDay(Calendar cal)
  4. getDay(Calendar calendar)
  5. getDay(Calendar calendar)
  6. getDayName(Calendar cal)
  7. getDayOfPeriod(Calendar cal, long timems)
  8. getDaysFromThen(Calendar aDate)
  9. getDayStr(Calendar cal)