There is a mysql config that impacts fractional seconds
https://dev.mysql.com/doc/refman/5.7/en/fractional-seconds.html
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've created a Laravel 5.4 app that is working with a remote SQL Server database. Both production and development are using the exact same remote database and are both Ubuntu 16.04 and PHP 7.0.
In development, everything looks fine, but in production, I'm getting an error any time I access one of my date properties on my Eloquent models.
In the model, I have protected $dateFormat = 'Y-m-d H:i:s.u';
When I go into tinker and just do App\Charge::first() the date is returned on the production server as
LastModifiedDate: "2016-07-18 16:47:46",
but on the development server, when I query the same database, I get
LastModifiedDate: "2016-07-18 16:47:46.513",
This difference in date format is making Carbon complain about missing data.
Any idea what could be causing this? Is there a PHP extension I'm missing perhaps?
Please or to participate in this conversation.