Java Month Add getEndOfMonth(Date currentDate)

Here you can find the source of getEndOfMonth(Date currentDate)

Description

get End Of Month

License

Open Source License

Return

the date that is the end of the month that the passed date is in

Declaration

public static Date getEndOfMonth(Date currentDate) 

Method Source Code

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

import java.util.*;

public class Main {
    /**/*  w  w  w . j a va 2  s  .  c  o m*/
     * @return the date that is the end of the month that the passed date is in
     */
    public static Date getEndOfMonth(Date currentDate) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(currentDate);
        cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
        return cal.getTime();
    }
}

Related

  1. addMonths(java.util.Date today, int monthsToAdd)
  2. addMonths(String s, int month)
  3. addMonths2(String dateStr, int months)
  4. addMonthsAndDays(Date date, int months, int days)
  5. addMonthTimetamp(long lTimeStamp, String _pattern, int month)
  6. getEndOfMonth(Date date)
  7. getEndOfMonth(long date)
  8. monthAdd(final String strDate, final int month)