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

Discussion in 'Ruby' started by Stuart Smith, Apr 14, 2005.

  1. Stuart Smith

    Stuart Smith Guest

    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
     
    Stuart Smith, Apr 14, 2005
    #1
    1. Advertising

  2. > 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.basecamphq.com/ -- Web-based Project Management
    http://www.rubyonrails.org/ -- Web-application framework for Ruby
    http://www.loudthinking.com/ -- Broadcasting Brain
     
    David Heinemeier Hansson, Apr 14, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Berg
    Replies:
    0
    Views:
    799
    Chris Berg
    Oct 27, 2003
  2. Soefara
    Replies:
    0
    Views:
    860
    Soefara
    Feb 10, 2004
  3. Thomas Matthews
    Replies:
    6
    Views:
    1,075
    Peter van Merkerk
    Aug 23, 2003
  4. Summu82
    Replies:
    5
    Views:
    872
    Richard Heathfield
    Jun 7, 2006
  5. Jonathan Wood
    Replies:
    7
    Views:
    367
    Jonathan Wood
    Nov 15, 2007
Loading...

Share This Page