On 11/7/05, CSN
<cool_screen_name90001-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
wrote:> I can''t figure out how to format variables to custom
> date/time formats. In a template, I have:
>
> item.added.to_formatted_s(:format=>"%Y")
>
> and rather than the year, it outputs:
>
> Mon Oct 31 20:14:14 MST 2005
http://rails.rubyonrails.com/classes/ActiveSupport/CoreExtensions/Time/Conversions.html#M000186
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update(:format
=> ''%Y'')
item.added.to_s(:format)
--
rick
http://techno-weenie.net