Could not convert database value "00:00:00.0000000" to Doctrine Type Doctrine\DBAL\Types\TimeType (SQL Server)

## HTTP 500 <small>Internal Server Error</small> 

# Could not convert database value "00:00:00.0000000" to Doctrine Type Doctrine\\DBAL\\Types\\TimeType. Expected format "H:i:s".

### **Doctrine\\DBAL\\Types\\Exception\\InvalidFormat**

in [D:\\demo\\vendor\\doctrine\\dbal\\src\\Types\\Exception\\**InvalidFormat.php** ](file:///D:/demo/vendor/doctrine/dbal/src/Types/Exception/InvalidFormat.php#L26)(line 26)

21. `string $value,`

22. `string $toType,`

23. `        ?string $expectedFormat,`

24. `        ?Throwable $previous = null,`

25. `    ): self {`

26. `        return new self(`

27. `sprintf(`

28. `'Could not convert database value "%s" to Doctrine Type %s. Expected format "%s".',`

29. `strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value,`

30. `$toType,`

31. `$expectedFormat ?? '',`


in [D:\\demo\\vendor\\doctrine\\dbal\\src\\Types\\**TimeType.php** ](file:///D:/demo/vendor/doctrine/dbal/src/Types/TimeType.php#L63)(line 63)

58. `$dateTime = DateTime::createFromFormat('!' . $platform->getTimeFormatString(), $value);`

59. `        if ($dateTime !== false) {`

60. `            return $dateTime;`

61. `        }`

62. 

63. `        throw InvalidFormat::new(`

64. `$value,`

65. `            static::class,`

66. `$platform->getTimeFormatString(),`

67. `        );`

68. `    }`

i do have time field on sql server databes (time)

  1. You may post the table schema (CREATE TABLE statement) for recreating the table and testing.
  2. Which version of SQL Server are you using? Make sure you use MSSQL >= 2017.
CREATE TABLE [dbo].[casesJalsat] (
    [casesJalsatID] INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
    [caseid] INT NULL,
    [caseEvntDate] DATETIME NULL,
    [caseEvntTime] TIME(7) NULL,
    [CasesJlsatEnd] DATETIME NULL,
    [CourtEvntLevel] NVARCHAR(MAX) NULL,
    [TybeOfEvnt] NVARCHAR(MAX) NULL,
    [EvntStatus] NVARCHAR(MAX) NULL,
    [RequstOnEvnt] NVARCHAR(MAX) NULL,
    [NajizUrl] NVARCHAR(MAX) NULL,
    [EvntReport] NVARCHAR(MAX) NULL,
    [CasesDitils] NVARCHAR(MAX) NULL,
    [EvntEmployye] NVARCHAR(MAX) NULL,
    [Online] NVARCHAR(MAX) NULL,
    [AllDay] BIT NULL,
    [UserLevelEvnt] NVARCHAR(MAX) NULL,
    [files] VARBINARY(MAX) NULL
);

Microsoft SQL Server 2022 (RTM-GDR) (KB5065221) - 16.0.1150.1 (X64) Aug 13 2025 16:27:21 Copyright (C) 2022 Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 10.0 (Build 26200: ) (Hypervisor)

This issue is common when TIME(7) precision is used. If you can, alter your schema to TIME(0).

it is goooooooooooood now thanks