List of utility methods to do Leap Year Check
int | getLeapYear(int theyear) get Leap Year return ((theyear % 4 == 0 && theyear % 100 != 0) || theyear % 400 == 0) ? 29 : 28;
|
int | getMonthOfYear(int dayOfYear, boolean leap) Converts the number of elapsed days from beginning of the year to the corresponding month. int d = dayOfYear; if (d < DAYS_JANUARY) { return 1; if (leap) { d--; if (d < DAYS_FEBRUARY) { ... |
boolean | isGregorianLeapYear(int gregorianYear) is Gregorian Leap Year return (((gregorianYear % 4) == 0) && (((gregorianYear % 100) != 0) || ((gregorianYear % 400) == 0)));
|
boolean | isGregorianLeapYear(int gregorianYear) Returns whether the specified year is a leap year in the Gregorian calendar system. return (((gregorianYear % 4) == 0) && (((gregorianYear % 100) != 0) || ((gregorianYear % 400) == 0)));
|
boolean | isJalaliLeapYear(int year) is Jalali Leap Year int mod = (year + 11) % 33; if ((mod != 32) && ((mod % 4) == 0)) { return true; } else { return false; |
boolean | isJulianLeapYear(int normalizedJulianYear) Returns whether the specified year is a leap year in the Julian calendar system. return (normalizedJulianYear % 4) == 0;
|
boolean | isJulianLeapYear(int normalizedJulianYear) is Julian Leap Year return (normalizedJulianYear % 4) == 0;
|
boolean | isLeapYear(final int year) Determines if the supplied year is a leap year boolean isLeapYear; isLeapYear = year % 4 == 0; isLeapYear = isLeapYear && year % 100 != 0; return isLeapYear || year % 400 == 0; |
boolean | isLeapYear(final int year) is Leap Year return ((year % 4) == 0)
&& ((year < 1582)
|| ((year % 100) != 0)
|| ((year % 400) == 0));
|
boolean | isLeapYear(int prolepticYear) Checks if the year is a leap year, according to the ISO proleptic calendar system rules. return ((prolepticYear & 3) == 0) && ((prolepticYear % 100) != 0 || (prolepticYear % 400) == 0);
|