Hi everyone,
In a current project, our client is using an IIS 7.5 web server alongside with a MS SQL Server 2008. In all of this tables, every datetime field is a datetime2 field, e.g.
CREATE TABLE [dbo].[user] (
[id] INT IDENTITY(1,1) NOT NULL,
[name] VARCHAR(30) NOT NULL,
[created_at] DATETIME2(7) NOT NULL DEFAULT (getdate()),
[updated_at] DATETIME2(7) NOT NULL DEFAULT (getdate()),
[deleted_at] DATETIME2(7) NULL DEFAULT NULL,
PRIMARY KEY(id)
)
Using Laravel 5, I get the following error as soon as I try to retrieve data via Eloquent:
InvalidArgumentException in Carbon.php line 387:
The format separator does not match
Trailing data
in Carbon.php line 387
at Carbon::createFromFormat('Y-m-d H:i:s.000', '2015-04-20 14:49:51.4130000') in Model.php line 2885
at Model->asDateTime('2015-04-20 14:49:51.4130000') in Model.php line 2390
at Model->attributesToArray() in Model.php line 2369
Is there any way I can use datetime2-fields without hacking the core?
Thanks in advance for your help!!