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. Advertisements

  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. Advertisements

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. Shaiboy_UK
    Replies:
    0
    Views:
    644
    Shaiboy_UK
    Oct 19, 2003
  2. Brian Candy
    Replies:
    2
    Views:
    1,468
    Janaka
    Feb 18, 2004
  3. Chris Berg
    Replies:
    0
    Views:
    1,095
    Chris Berg
    Oct 27, 2003
  4. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,804
    Michael Borgwardt
    May 30, 2004
  5. Keith Cochrane
    Replies:
    2
    Views:
    860
    Keith Cochrane
    Aug 6, 2006
  6. Summu82
    Replies:
    5
    Views:
    1,139
    Richard Heathfield
    Jun 7, 2006
  7. dch3
    Replies:
    2
    Views:
    659
  8. Shaiboy_UK

    Time/Date format and changing time to GMT

    Shaiboy_UK, Oct 19, 2003, in forum: ASP General
    Replies:
    1
    Views:
    333
    Bob Barrows
    Oct 19, 2003
Loading...