Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
final thisYear = DateTime.now().year;
final isLeap = DateTime(year, 2, 29).month == 2;
not y % 4 and (y % 100 != 0 or not y % 400)
leap_year = False
if not year % 4:
if year % 100 or not year % 400:
leap_year = True
let leap_year = year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);