MCPcopy Create free account
hub / github.com/6tail/lunar-java / isLeapYear

Method isLeapYear

src/main/java/com/nlf/calendar/util/SolarUtil.java:220–225  ·  view source on GitHub ↗

是否闰年 @param year 年 @return true/false 闰年/非闰年

(int year)

Source from the content-addressed store, hash-verified

218 * @return true/false 闰年/非闰年
219 */
220 public static boolean isLeapYear(int year) {
221 if (year < 1600) {
222 return year % 4 == 0;
223 }
224 return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
225 }
226
227 /**
228 * 获取某年有多少天(平年365天,闰年366天)

Callers 5

test10Method · 0.95
isLeapYearMethod · 0.95
nextYearMethod · 0.95
getDaysOfYearMethod · 0.95
getDaysOfMonthMethod · 0.95

Calls

no outgoing calls

Tested by 1

test10Method · 0.76