Skip to content

Instantly share code, notes, and snippets.

@wx13
Created July 19, 2010 22:07
Show Gist options
  • Save wx13/482120 to your computer and use it in GitHub Desktop.
Save wx13/482120 to your computer and use it in GitHub Desktop.
ruby script to generate list of days in a year
#!/usr/bin/ruby
require 'date'
weekday = ["Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"]
month = ["", "January", "February", "March", "April", "May",
"June", "July", "August", "September", "October",
"November", "December"]
for day in (1..365)
date = Date.ordinal(y=2009,d=day)
puts weekday[date.wday] + "," + " " + month[date.month] + " " + date.day.to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment