[Rails] date conversion

Rick Olson
Thu, 05 Jan 2006 15:09:14 -0000

> Your column should be named <foo>_on or <foo>_at and be of the
SQL
> Date type. You can then use the strftime method to format the date as
> you wish. As in:
> model.bought_on.strftime("%B, %d, %Y") which will display the
date in
> the format you''ve requested.
> Cheers,
> Hasan Diwan <hasan.diwan@gmail.com>

I have a post on defining named time formats.  This way you''re not
littering your app with direct calls to #strftime.

http://rails.techno-weenie.net/tip/2005/11/20/defining_custom_date_time_formats

--
rick