Java Date to Day getDayEnd(Date date)

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

Description

get Day End

License

Apache License

Declaration

public static Date getDayEnd(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 getDayEnd(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);/*from   w  w  w .j ava 2s.co  m*/
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.DAY_OF_MONTH, 1);
        calendar.add(Calendar.MILLISECOND, -1);
        return calendar.getTime();
    }
}

Related

  1. getDay(Date dateParam)
  2. getDay(java.util.Date date)
  3. getDay(String strDate)
  4. getDayBetween(Date startDate, Date endDate)
  5. getDayCount(java.util.Date _startDate, java.util.Date _endDate)
  6. getDayEnd(Date date)
  7. getDayEnd(Date date)
  8. getDayEnd(Date obj)
  9. getDayEnd(final Date date, TimeZone timezone)