[Rails] postgresql date
Scott Barron
scott at elitists.net
Wed Mar 2 14:08:41 GMT 2005
Enrico Teotti wrote:
> If I select my date column from the pgadmin I see that in the ddmmyyyy
> form, I've specified so in the postgresql config. When I query from
> rails I get the date in yyyymmdd someone knows why?
> Thanks
> Enrico
>
Enrico,
ActiveRecord will convert this to the Ruby Date type, which will default
to YYYY-MM-DD in its to_s method. You can use the strftime method to
display the date how you wish to display it.
-Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : http://one.textdrive.com/pipermail/rails/attachments/20050302/ab55ff45/signature.bin
More information about the Rails
mailing list