Created
July 19, 2010 22:07
-
-
Save wx13/482120 to your computer and use it in GitHub Desktop.
ruby script to generate list of days in a year
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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