Java Day End endOfDay(final Date date)

Here you can find the source of endOfDay(final Date date)

Description

end Of Day

License

Open Source License

Declaration

public static Date endOfDay(final Date date) 

Method Source Code

//package com.java2s;

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

public class Main {

    public static Date endOfDay(final Date date) {
        if (date == null) {
            return null;
        }/* w ww  . j a  v a2 s  . c o  m*/
        final Calendar dateCal = Calendar.getInstance();
        dateCal.setLenient(false);
        dateCal.setTime(date);
        dateCal.set(Calendar.HOUR_OF_DAY, 23);
        dateCal.set(Calendar.MINUTE, 59);
        dateCal.set(Calendar.SECOND, 59);
        return dateCal.getTime();
    }
}

Related

  1. endOfDay(Date date)
  2. endOfDay(Date dateInst)
  3. endOfDay(Date dt)
  4. endOfDay(Date inDate, TimeZone timeZone)
  5. endOfDay(Date value)
  6. endOfDay(final Date date)
  7. endOfDayDate(Date date)
  8. endOfDayInMillis(long date)
  9. endOfTheMonth(java.util.Date date, Locale locale)