Java Day End getDateEnd(java.util.Date d)

Here you can find the source of getDateEnd(java.util.Date d)

Description

get Date End

License

Apache License

Declaration

public static java.util.Date getDateEnd(java.util.Date d) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    public static java.util.Date getDateEnd(java.util.Date d) {
        Calendar c = Calendar.getInstance();
        c.clear();/*w  ww . ja v a 2 s  . co m*/
        Calendar co = Calendar.getInstance();
        co.setTime(d);
        c.set(Calendar.DAY_OF_MONTH, co.get(Calendar.DAY_OF_MONTH));
        c.set(Calendar.MONTH, co.get(Calendar.MONTH));
        c.set(Calendar.YEAR, co.get(Calendar.YEAR));
        c.add(Calendar.DAY_OF_MONTH, 1);
        c.add(Calendar.MILLISECOND, -1);
        return c.getTime();
    }
}

Related

  1. getApartDate(Date startDate, Date endDate)
  2. getBetweenDays(String strFromDate, String strToDate)
  3. getCalender(Date date)
  4. getCertificateEndDate(int days)
  5. getDatebetweenOfDays(Date startDate, Date endDate)
  6. getDateEndDay()
  7. getDateInterval4EndDate(Date date, int hourModify)
  8. getDateList(Date begin, Date end)
  9. getDatesBetweenTwoDate(Date beginDate, Date endDate)