以下是一些输出:
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"
Run Code Online (Sandbox Code Playgroud)
现在我需要输出格式,即:
Monday 25th, June or Thrusday, 1st, October
Run Code Online (Sandbox Code Playgroud)
问题是to_formatted_s和strftime仅适用于日期和两者或它们返回字符串.如何以我需要的方式获得输出.