Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-860

MsSQL-Server DateTime microseconds issue

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.2
    • Component/s: Platforms
    • Security Level: All
    • Labels:
      None
    • Environment:
      WindowsXP/Windows2008 R2 / PHP 5.3 / MsSQL-Server 2005 / MsSQL-PDO_PHP-Driver

      Description

      The string for the function getDateTimeFormatString() in the MsSqlPlatform class is 'wrong'.
      The Microsoft-SQL-Server just uses 3 digits for microseconds and not 6.
      So the string 'Y-m-d H:i:s.u' fails and the server states: [SQL Server]Fehler beim Konvertieren einer Zeichenfolge in einen datetime-Wert (Error when converting a string to a datetime-value) .

      So this string works, but does not regard the microseconds for those how rely on them: 'Y-m-d H:i:s.000'

      See also:
      [...] The MS datetime column is documented to have an accuracy of only about .3 seconds anyway [...]
      http://bytes.com/topic/sql-server/answers/80150-inserting-datetime-milliseconds-sql-server

      http://msdn.microsoft.com/en-gb/library/ms186819.aspx (Section: Remarks)

        Activity

          People

          • Assignee:
            Juozas Kaziukenas
            Reporter:
            Martin Weise
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: