I was already looking for this, and I found several topics discussing this issue, however, none of which I felt was the way I want to go, so I hope to get a better offer here.
I want to get the timestamp since the last update of the user.
$user->updated_at
If I ran this, he gave me this error
Object of class Carbon\Carbon could not be converted to int
This is because it returns a Carbon instance in Laravel 5.2, and I only need a timestamp.
Carbon {#303 โผ +"date": "2017-01-04 00:35:38.000000" +"timezone_type": 3 +"timezone": "UTC" }
How to get the โdateโ from a carbon instance, so I only get 2017-01-04 00:35:38 - I have no idea where .000000 comes from, because it does not appear in the database. In the MySQL database, it just shows 2016-07-20 20:23:07 as a timestamp .
I hope for some recommendations and suggestions
source share