Skip to content

Instantly share code, notes, and snippets.

@tarynsauer
Created June 30, 2013 00:21
Show Gist options
  • Save tarynsauer/5893240 to your computer and use it in GitHub Desktop.
Save tarynsauer/5893240 to your computer and use it in GitHub Desktop.
Detecting leap years
def leap_year?(year)
year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment