Skip to content

Instantly share code, notes, and snippets.

@vagmi
Created February 28, 2013 17:01
Show Gist options
  • Select an option

  • Save vagmi/5058247 to your computer and use it in GitHub Desktop.

Select an option

Save vagmi/5058247 to your computer and use it in GitHub Desktop.
A lot of people were sending me emails about Friday the 29th of February. What they forget is that 2013 is not a leap year. The nearest leap year where Feb 29th is a friday is 2036. If you do not believe me, you can run the script your self.
require 'date'
year=2012
until(DateTime.parse("#{year}-02-29").strftime("%a")=="Fri")
year=year+4
end
puts year
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment