Java Calendar Day convertEndOfDay(Calendar cal)

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

Description

convert End Of Day

License

LGPL

Declaration

public static Calendar convertEndOfDay(Calendar cal) 

Method Source Code

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

Related

  1. afterCurrentDay(Calendar time)
  2. calendarAtStartOfToday()
  3. calendarDayToOrdinalDay(int dow)
  4. calToBeginningOfDay(Calendar c)
  5. ceilAllLessThanDay(Calendar cal)
  6. copyCalendarDay(final Calendar src, final Calendar dest)
  7. createBeginningOfDay(Calendar calendar)
  8. date2day(Calendar cal)
  9. day(Calendar calendar)