# Text\_field as date

**URL:** <https://www.ruby-forum.com/t/text-field-as-date/168700>\
**Category:** Rails I18n\
**Created:** [May 24, 2009, 4:54pm UTC](https://www.ruby-forum.com/t/text-field-as-date/168700 "2009-05-24T16:54:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pink-ink](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9dc877/32.png) [@pink-ink](https://www.ruby-forum.com/u/pink-ink)\
**Post date:** [May 24, 2009, 4:54pm UTC](https://www.ruby-forum.com/t/text-field-as-date/168700/1 "2009-05-24T16:54:30Z")

</div>

Hi Ruby Comuniy!

I have implemented i18n and when I set the locale to “de” everthing  
works fine, I mean date\_select shows the german date-format.

The problem is, that I want to use a text\_field for date-input like:

\<%= f.text\_field :date\_test %\>

But when I open the edit.html.erb the date-output is not the “de-fromat”  
like 31.12.2008 it is the database format like 2008-12-31.

I tried something like

\<%= l f.text\_field :date\_test %\>

but then I get this error message:

“Object must be a Date, DateTime or Time object”

Do somebody knows a solution?

Thanks ahead!!!

Regs Hermann
