-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
- Laravel Version: 5.8.16
- PHP Version: 7.3.5
- Database Driver & Version: MSSQL / Microsoft SQL Server 2016 - 13.0.5292.0
Description:
When we fetch dates either from direct DB statement or Eloquent we get the date
field in the SQL database returned as an invalid formatted date string like Sep 12 2018 12:00:00:AM
.
First of all, the last :
before AM
results in Carbon giving an exception as it's an invalid date format. With that removed Carbon can recognize the date again.
However we can't seem to figure out why Laravel formats this date in the first place. We have no models for the given table (no dates are mutated) and the date is stored as YYYY-MM-DD
in the database.
An example DB statement is DB::connection('database')->table('table')->get()
We've tested this with MySQL, the problem is not present there. Once we switch back to MSSQL the issue returned.
Steps To Reproduce:
- Fetch a record from the database where a field with type
date
is present. - The returned record is formatted invalid with
Sep 12 2018 12:00:00:AM
, should be2018-09-12
.
Metadata
Metadata
Assignees
Labels
No labels