Loading ...
Sorry, an error occurred while loading the content.

MSSQL 7 and timestamps

Expand Messages
  • dcpck2004
    Hello, I ve recently started playing with Metabase as a solution for my PHP database abstraction needs. I m trying to write a project that needs to be
    Message 1 of 3 , Sep 7, 2004
    View Source
    • 0 Attachment
      Hello,

      I've recently started playing with Metabase as a solution for my PHP
      database abstraction needs. I'm trying to write a project that needs
      to be portable across many different databases, and I'm hoping
      Metabase will help me do that, however...

      I've read the other comments about MSSQL and dates/times/timestamps
      not being translated to the ISO format. I need to get this
      functionalilty working. Is a solution in the works or already done?
      Surely it can be done either with the "convert" SQL functions or
      within PHP using regular expression manipulation? What is the best
      way to procede with getting this sorted out?

      Thanks

      Dave
    • Lukas Smith
      ... this may help: Ini setting for output formatting: ini_set( mssql.datetimeconvert , Off ); Query on startup to tell the server how input will have date
      Message 2 of 3 , Sep 7, 2004
      View Source
      • 0 Attachment
        dcpck2004 wrote:

        > Hello,
        >
        > I've recently started playing with Metabase as a solution for my PHP
        > database abstraction needs. I'm trying to write a project that needs
        > to be portable across many different databases, and I'm hoping
        > Metabase will help me do that, however...
        >
        > I've read the other comments about MSSQL and dates/times/timestamps
        > not being translated to the ISO format. I need to get this
        > functionalilty working. Is a solution in the works or already done?
        > Surely it can be done either with the "convert" SQL functions or
        > within PHP using regular expression manipulation? What is the best
        > way to procede with getting this sorted out?

        this may help:

        Ini setting for output formatting:
        ini_set('mssql.datetimeconvert', 'Off');

        Query on startup to tell the server how input will have date parts
        ordered:
        SET DATEFORMAT ymd

        regards,
        Lukas Smith
        smith@...
        _______________________________
        BackendMedia
        www.backendmedia.com
        berlin@...

        Linn Zwoch Smith GbR
        Pariser Str. 44
        D-10707 Berlin

        Tel +49 30 83 22 50 00
        Fax +49 30 83 22 50 07
      • Manuel Lemos
        Hello, ... The Metabase solves that by creating fixed size text fields. Although text fields may not be suitable for all dates operations they are sufficient
        Message 3 of 3 , Sep 7, 2004
        View Source
        • 0 Attachment
          Hello,

          On 09/07/2004 11:59 AM, dcpck2004 wrote:
          > I've read the other comments about MSSQL and dates/times/timestamps
          > not being translated to the ISO format. I need to get this
          > functionalilty working. Is a solution in the works or already done?
          > Surely it can be done either with the "convert" SQL functions or
          > within PHP using regular expression manipulation? What is the best
          > way to procede with getting this sorted out?

          The Metabase solves that by creating fixed size text fields. Although
          text fields may not be suitable for all dates operations they are
          sufficient for most (really) portable that you may want to perform
          including comparisions and sorting. You may want to double check that by
          configuring and running the driver conformance test suite script
          driver_test_configuration.php .

          This remained that way because the original driver was written to work
          with MS SQL server 6, which unlike other databases did not provide a way
          to let database clients tell the server to return dates formatted in the
          ISO format. I don't know about newer versions.

          This solution was preferred to having to guess the current server date
          and time format parse it to retrieve dates in ISO format as every other
          driver. If newer versions provide new means to assure return correctly
          formatted dates without these tricks, it would not be hard to add an
          option to the MS SQL driver to use real date and time fields instead of
          text fields.

          --

          Regards,
          Manuel Lemos

          PHP Classes - Free ready to use OOP components written in PHP
          http://www.phpclasses.org/

          PHP Reviews - Reviews of PHP books and other products
          http://www.phpclasses.org/reviews/

          Metastorage - Data object relational mapping layer generator
          http://www.meta-language.net/metastorage.html
        Your message has been successfully submitted and would be delivered to recipients shortly.