问题
how can I get the name of the day in Ruby.
For eg. something like that:
a = Date.today
a.day_name
=> Tuesday
the only thing i could find was .wday
but that only returns for the number of the day in the week
a.wday
=> 2
回答1:
Time.now.strftime("%A")
# => "Tuesday"
or
Date.today.strftime("%A")
# => "Tuesday"
来源:https://stackoverflow.com/questions/29365439/get-name-of-the-day