# How to display date\_of\_birth field column in db having type

**URL:** <https://www.ruby-forum.com/t/how-to-display-date-of-birth-field-column-in-db-having-type/68387>\
**Category:** Rails\
**Created:** [September 12, 2006, 9:46am UTC](https://www.ruby-forum.com/t/how-to-display-date-of-birth-field-column-in-db-having-type/68387 "2006-09-12T09:46:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anildigital](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@anildigital](https://www.ruby-forum.com/u/anildigital)\
**Post date:** [September 12, 2006, 9:46am UTC](https://www.ruby-forum.com/t/how-to-display-date-of-birth-field-column-in-db-having-type/68387/1 "2006-09-12T09:46:18Z")

</div>

Hi all,

I want to display select boxes for selecting data\_of\_birth. I want only  
three select boxes for selection of day, month and year. And it should  
be  
tied with model. I tried ‘datetime\_select’. But it displays some extra  
select boxes for selecting time. Also it displays order Year, Month and  
day.  
I want order to be Day, Moth, Year. I don’t want to select time. But my  
table have column date\_of birth having type DateTime.

Please give me some guidelines

–  
Don’t live to geek; geek to live.  
[http://anildigital.blogspot.com](http://anildigital.blogspot.com)

---

<div class="post-metadata">

**Author:** ![anildigital](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@anildigital](https://www.ruby-forum.com/u/anildigital)\
**Post date:** [September 12, 2006, 11:02am UTC](https://www.ruby-forum.com/t/how-to-display-date-of-birth-field-column-in-db-having-type/68387/2 "2006-09-12T11:02:00Z")

</div>

Dear Anil:

I just tried the following and it works (even with your column being a  
datetime):

\<%= date\_select ‘my\_entity’, ‘date\_of’, {:order =\> [:month, :day,  
:year]} %\>

From looking at data after updating to db, I saw that the timestamp  
portion was being set to 00:00 in sqlite3.

I was inspired by:  
[http://rails.techno-weenie.net/question/2006/6/30/reconstructing-a-date-from-date\_select](http://rails.techno-weenie.net/question/2006/6/30/reconstructing-a-date-from-date_select)

I tried \<%= datetime\_select ‘my\_entity’, ‘date\_of’, {:order =\> [:month,  
:day, :year]} %\>, and this did do what I expected it to do.

Hope this helps!  
Dominique

Anil W. wrote:

> Hi all,
> 
> I want to display select boxes for selecting data\_of\_birth. I want only  
> three select boxes for selection of day, month and year. And it should  
> be  
> tied with model. I tried ‘datetime\_select’. But it displays some extra  
> select boxes for selecting time. Also it displays order Year, Month and  
> day.  
> I want order to be Day, Moth, Year. I don’t want to select time. But my  
> table have column date\_of birth having type DateTime.
> 
> Please give me some guidelines
> 
> –  
> Don’t live to geek; geek to live.  
> [http://anildigital.blogspot.com](http://anildigital.blogspot.com)
