[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

What determines the date/time format for SELECT statements in Rails?

stuart

4/14/2005 10:53:00 AM

If I issue a select statement on a table containing
date/time/datetime/timestamp columns (type depends on backend DB)can I
guarantee that the returned formatted output from the corresponding
ActiceRecord column will always be the same regardless of the backend
DB.

The format appears to be 'YYYY-MM-DD HH:MM:SS'; what sets up the
format and can I change it?

Thanks
1 Answer

David Heinemeier Hansson

4/14/2005 11:27:00 AM

0

> If I issue a select statement on a table containing
> date/time/datetime/timestamp columns (type depends on backend DB)can I
> guarantee that the returned formatted output from the corresponding
> ActiceRecord column will always be the same regardless of the backend
> DB.

Active Record doesn't support timestamp columns, but all the others are
turned into Date or Time objects regardless of the database behind.
That's part of the job of the adapters. Exposing a common front for
Active Record to operate on the database.
--
David Heinemeier Hansson,
http://www.basec... -- Web-based Project Management
http://www.rubyon... -- Web-application framework for Ruby
http://www.loudthi... -- Broadcasting Brain