Java Day End getMonthEnd(Date date)

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

Description

get Month End

License

Apache License

Declaration

public static Date getMonthEnd(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 getMonthEnd(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);//from w  w  w . ja  va2  s.co  m
        calendar.add(Calendar.MONTH, 1);
        int index = calendar.get(Calendar.DAY_OF_MONTH);
        calendar.add(Calendar.DATE, (-index));
        return calendar.getTime();
    }
}

Related

  1. getMinllisBetween(Date beginDate, Date endDate)
  2. getMondays(Date startDate, Date endDate)
  3. getMonthBetween(Date startDate, Date endDate)
  4. getMonthCha(Date start, Date end)
  5. getMonthCount(Date startDate, Date endDate)
  6. getMonthEndDate(Date date)
  7. getMonthEndDate(int year, int month)
  8. getMonthEndDate(Long day)
  9. getMonthFirstDays(Date startDate, Date endDate)