Java Leap Year Check isGregorianLeapYear(int gregorianYear)

Here you can find the source of isGregorianLeapYear(int gregorianYear)

Description

Returns whether the specified year is a leap year in the Gregorian calendar system.

License

Apache License

Parameter

Parameter Description
gregorianYear a Gregorian calendar year

Return

true if the given year is a leap year in the Gregorian calendar system.

Declaration

public static final boolean isGregorianLeapYear(int gregorianYear) 

Method Source Code

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

public class Main {
    /**/*from  w ww .j  a va 2s. c om*/
     * Returns whether the specified year is a leap year in the Gregorian
     * calendar system.
     * 
     * @param gregorianYear
     *            a Gregorian calendar year
     * @return true if the given year is a leap year in the Gregorian calendar
     *         system.
     * @see CalendarDate#isLeapYear
     */
    public static final boolean isGregorianLeapYear(int gregorianYear) {
        return (((gregorianYear % 4) == 0) && (((gregorianYear % 100) != 0) || ((gregorianYear % 400) == 0)));
    }
}

Related

  1. getLeapYear(int theyear)
  2. getMonthOfYear(int dayOfYear, boolean leap)
  3. isGregorianLeapYear(int gregorianYear)
  4. isJalaliLeapYear(int year)
  5. isJulianLeapYear(int normalizedJulianYear)
  6. isJulianLeapYear(int normalizedJulianYear)
  7. isLeapYear(final int year)