Java Day End isEndOfMonth(Date d)

Here you can find the source of isEndOfMonth(Date d)

Description

is End Of Month

License

Open Source License

Declaration

public static boolean isEndOfMonth(Date d) 

Method Source Code

//package com.java2s;
/**/*from w  ww  .j  av  a  2s. c  o m*/
 * Copyright (c) 2012 Todoroo Inc
 *
 * See the file "LICENSE" for the full license governing this code.
 */

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

public class Main {
    public static boolean isEndOfMonth(Date d) {
        int date = d.getDate();
        if (date < 28)
            return false;

        int month = d.getMonth();
        if (month == Calendar.FEBRUARY)
            return date >= 28;

        if (month == Calendar.APRIL || month == Calendar.JUNE || month == Calendar.SEPTEMBER
                || month == Calendar.NOVEMBER)
            return date >= 30;

        return date >= 31;
    }
}

Related

  1. getYearsBetween(Date startDate, Date endDate)
  2. getYearsBetweenDate(Date begin, Date end)
  3. isBetweenDate(Date date, Date startDate, Date endDate)
  4. isBetWeenDates(Date in, Date from, Date to)
  5. isCalenderDaySame(GregorianCalendar aInCal1, GregorianCalendar aInCal2)
  6. isEndOfMonth(Date date)
  7. isEndOfMonth(Date nowday)
  8. isEndOfSeason(Date date)
  9. isEqualYMD(Date begindate, Date enddate)