Last active
August 29, 2015 14:05
-
-
Save metallurgix/a8f63b61a101fedc5c58 to your computer and use it in GitHub Desktop.
Day of the week using Date
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
require "date" | |
days=["Sunday","Monday","Tuesday","Wednesday","Thursday", "Friday","Saturday"] | |
test_date=Date.new(2014,8,10) | |
#test_date.wday -> returns 0-6 | |
puts days[test_date.wday] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment