Skip to content

Instantly share code, notes, and snippets.

@metallurgix
Last active August 29, 2015 14:05
Show Gist options
  • Save metallurgix/a8f63b61a101fedc5c58 to your computer and use it in GitHub Desktop.
Save metallurgix/a8f63b61a101fedc5c58 to your computer and use it in GitHub Desktop.
Day of the week using Date
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