以下是一些输出结果:
现在我需要以以下格式输出:
Date.today => Mon, 25 Jun 2012
Date.today.to_formatted_s(:long_ordinal) => "June 25th, 2012"
Date.today.strftime('%A %d, %B') => "Monday 25, June"
现在我需要以以下格式输出:
Monday 25th, June or Thrusday, 1st, October
问题在于to_formatted_s
和strftime
仅适用于日期,且两者都返回字符串。我该如何以所需的方式获取输出?