How can I calculate the day of the week of a date in ruby?

前端 未结 10 619
抹茶落季
抹茶落季 2020-12-01 05:05

How can I calculate the day of the week of a date in Ruby? For example, October 28 of 2010 is = Thursday

10条回答
  •  悲哀的现实
    2020-12-01 05:27

    Works out of the box with ruby without requiring:

    Time.now.strftime("%A").downcase #=> "thursday"
    

提交回复
热议问题