标签: ruby
如何将datetime对象转换为此格式Thu, 02 July 2015
Thu, 02 July 2015
那是WEEKDAY, DAY MONTH YEAR
WEEKDAY, DAY MONTH YEAR
答案 0 :(得分:5)
您应该使用格式字符串:
require 'date' DateTime.now.strftime("%a, %d %b %Y") # => "Wed, 10 Jun 2015" DateTime.now.strftime("%a, %d %B %Y") # => "Wed, 10 June 2015"