Forum: Ruby on Rails date environment.rb

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Herman M. (Guest)
on 2009-05-17 22:21
Hi Ruby-Comunity!

I have a problem with date format.

To display the german date format, I put on the end of environment.rb:

=> '%d.%m.%Y')
=> '%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!!


Franco C. (Guest)
on 2009-05-18 01:38
(Received via mailing list)
You can do this with i18n (Rails >= 2.2) setting up properly the
format in your config/locales (see examples in and
then use <%= l(some_date) %>.


Franco C..

On May 17, 3:21 pm, Herman Müller <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.