Thursday
May152008
Rails date formats
Thursday, May 15, 2008 at 4:04PM
Handy:
In console:
Prints a list of each available format with an example.
Would be better as a rake task.
In console:
Date::DATE_FORMATS.each_pair {|key, value|puts "#{key} => #{Date.today.to_s(key)}"}Prints a list of each available format with an example.
short => 15 May
long => May 15, 2008
long_ordinal => May 15th, 2008
db => 2008-05-15
rfc822 => 15 May 2008
number => 20080515
Would be better as a rake task.

Reader Comments