Java Day End getEndTimeOfDay(Date date)

Here you can find the source of getEndTimeOfDay(Date date)

Description

get End Time Of Day

License

Apache License

Declaration

public static Date getEndTimeOfDay(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;

public class Main {

    public static Date getEndTimeOfDay(Date date) {
        Calendar calender = Calendar.getInstance();
        calender.setTime(date);//w  w  w. j  a  v  a 2  s  .c om
        setEndTimeOfDay(calender);
        return calender.getTime();

    }

    private static void setEndTimeOfDay(Calendar calender) {
        calender.set(Calendar.HOUR_OF_DAY, calender.getActualMaximum(Calendar.HOUR_OF_DAY));
        calender.set(Calendar.MINUTE, calender.getActualMaximum(Calendar.MINUTE));
        calender.set(Calendar.SECOND, calender.getActualMaximum(Calendar.SECOND));
        calender.set(Calendar.MILLISECOND, calender.getActualMaximum(Calendar.MILLISECOND));
    }
}

Related

  1. getEndOfHour(Date day)
  2. getEndOfTheDate(Date date)
  3. getEndOfYear(Date dt)
  4. getEndQuaterly(Date startDate)
  5. getEndSixMonthly(Date startDate)
  6. getEndTimeOfDayOrNow(Date date)
  7. getKalenderWoche(final Date date, final Locale locale)
  8. getLastDayEnding(Date date, int field)
  9. getMinllisBetween(Date beginDate, Date endDate)