找到PHP时间戳的差异?

I have a timestamp like this, I'm trying to calculate how long between created_at and closed_at, so how long the session lasted.

{{ Carbon\Carbon::parse($clientLogin->closed_at - $clientLogin->created_at)->diffForHumans() }}

Although it wont let me compare it?

Object of class Illuminate\Support\Carbon could not be converted to int (View: C:\Users\admin\Desktop\workspace\document_rootesources\views\user\logs.blade.php)

Try the below code :

Carbon\Carbon::parse($clientLogin->getOriginal('closed_at'))->diffForHumans(Carbon::parse($clientLogin->getOriginal('created_at')), true);