如何在Ruby中获取日期名称。例如。像这样的东西:a = Date.today a.day_name => Tuesday 我唯一能找到的就是.wday,但这只返回星期几a.wday => 2 最佳答案 Time.now.strftime("%A") # => "Tuesday" 要么Date.today.strftime("%A") # => "Tuesday"