# ActiveRecord: created\_at/\_on / updated\_at/\_on data type

**URL:** <https://www.ruby-forum.com/t/activerecord-created-at-on-updated-at-on-data-type/111842>\
**Category:** Rails\
**Created:** [August 12, 2007, 2:09am UTC](https://www.ruby-forum.com/t/activerecord-created-at-on-updated-at-on-data-type/111842 "2007-08-12T02:09:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 12, 2007, 2:09am UTC](https://www.ruby-forum.com/t/activerecord-created-at-on-updated-at-on-data-type/111842/1 "2007-08-12T02:09:49Z")

</div>

Quick question, before I monkey up my db.  
In ActiveRecord, regarding the magic column names created\_at  
created\_on updated\_at updated\_on

They’re all mentioned in AWDWR and the API docs, but …  
What data type do they each need to use? timestamp? datetime?  
What is the formatting returned as? A Ruby Time class object?  
Are they really updated automatically on creation / changes to a db  
row?

Thanks for any help,  
John J.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 12, 2007, 6:30am UTC](https://www.ruby-forum.com/t/activerecord-created-at-on-updated-at-on-data-type/111842/2 "2007-08-12T06:30:07Z")

</div>

Thanks, found it already. After posting of course.

Used rails console to find the return types. Glad I learned Ruby  
before Rails! irb (console) is a good friend!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 12, 2007, 2:46am UTC](https://www.ruby-forum.com/t/activerecord-created-at-on-updated-at-on-data-type/111842/3 "2007-08-12T02:46:51Z")

</div>

Hi, in the AWDwR on page 319 in the section tiltled “Magic Column  
Names”, it  
says that \_on will be mapped to date columns and \_at will be mapped to  
datetime.  
Good luck,

-Conrad

On 8/11/07, removed\_email\_address@domain.invalid \<
