You can do this with i18n (Rails >= 2.2) setting up properly the
format in your config/locales (see examples in
http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale) and
then use <%= l(some_date) %>.
Regards.
Franco Catena.
On May 17, 3:21 pm, Herman Müller
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hi Ruby-Comunity!
>
> I have a problem with date format.
>
> To display the german date format, I put on the end of environment.rb:
>
>
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default
> => ''%d.%m.%Y'')
>
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(:default
> => ''%d.%m.%Y %H:%M:%S'')
>
> In index/show.html.erb datetime is displayed like expected:
>
> 05.06.2009 10:00:00
>
> In edit.html.erb datetime is not displayed in german date format:
>
> <%= f.text_field :valid_from %> --> displays
>
> 2009-05-05 00:00:00
>
> Have somebody a solution?
>
> Thanks ahead!!
>
> Regs
>
> Hermann
> --
> Posted viahttp://www.ruby-forum.com/.