Java Date to Day getDayEnd(Date obj)

Here you can find the source of getDayEnd(Date obj)

Description

get Day End

License

Open Source License

Declaration

public static Date getDayEnd(Date obj) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {

    public static Date getDayEnd(Date obj) {
        if (obj == null) {
            throw new NullPointerException();
        }// ww w. ja v  a2  s.  co  m
        Calendar ca = new GregorianCalendar();
        ca.setTime(obj);
        ca.set(Calendar.HOUR_OF_DAY, 23);
        ca.set(Calendar.MINUTE, 59);
        ca.set(Calendar.SECOND, 59);
        return ca.getTime();
    }
}

Related

  1. getDayBetween(Date startDate, Date endDate)
  2. getDayCount(java.util.Date _startDate, java.util.Date _endDate)
  3. getDayEnd(Date date)
  4. getDayEnd(Date date)
  5. getDayEnd(Date date)
  6. getDayEnd(final Date date, TimeZone timezone)
  7. getDayFromDate(Date date)
  8. getDayMonthYear(Date aDate, boolean isAddSpace)
  9. getDayNumber(Date startDate, Date endDate)