Time.now.to_ordinalized_s :long
Gives you a relative date in an attractive format
format<String> |
strftime string used to format a time/date object |
locale<String, Symbol> |
An optional value which can be used by localization plugins |
Ordinalized time/date object |
5.days.ago.strftime_ordinalized('%b %d, %Y') # =>
# File lib/merb-helpers/date_time_formatting.rb, line 153 def strftime_ordinalized(fmt, format=nil) strftime(fmt.gsub(/(^|[^-])%d/, '\1_%d_')).gsub(/_(\d+)_/) { $1.to_i.ordinalize } end
Generated with the Darkfish Rdoc Generator 2.