List of utility methods to do Leap Year Check
boolean | isLeapYear(int year) return the leap year for years 1581-8999. if (year < 1000) throw new IllegalArgumentException("year must be four-digits"); return (year % 4) == 0 && (year % 100 != 0 || year % 400 == 0); |
boolean | isLeapYear(int year) is Leap Year boolean isLeapYear = false; if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) { isLeapYear = true; return isLeapYear; |
boolean | isLeapYear(int year) is Leap Year Calendar calendar = Calendar.getInstance();
return ((GregorianCalendar) calendar).isLeapYear(year);
|
boolean | isLeapYear(Integer year) is Leap Year boolean result = false; if (year % 100 == 0) { if (year % 400 == 0) { result = true; } else if (year % 4 == 0) { result = true; return result; |
boolean | isLeapYear(long year) Gets if a year is a leap year return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
|
boolean | isLeapYear(long year) Determines if the specified year is a leap year in the Persian calendar. return LEAP_CACHE[(int) (year - START)]; |
boolean | isLeapYear(String inputDate) is Leap Year return isLeapYear(Integer.parseInt(inputDate.substring(0, 4)));
|
boolean | leapYear(int year) leap Year return year % 4 == 0 && year % 400 == 0;
|
boolean | leapYear(int year) leap Year boolean leap; if (year % 4 == 0) { if (year % 100 == 0) { if (year % 400 == 0) leap = true; else leap = false; } else ... |
boolean | leapYear(int year) leap Year if (year < 4) { return false; return (year % 400 == 0) || (year % 100 != 0 && year % 4 == 0); |