是否闰年 @param year 年 @return true/false 闰年/非闰年
(int year)
| 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天) |
no outgoing calls