I am inserting date as timestamp datatype while inserting a record, i need to count difference between current date and the 'updated_at' date field of database in number of days.
I have explored Carbon api, but i am getting issue in date format matching as database has timestamp format and carbon has different.
How to get difference of date in days...??
I have fetched the date in same format but i don't know how to count difference in days.
You could also do :
$difference = $updated_at -> diffInDays(null, false);
because of this rule: "Each function below has a default first parameter which is the Carbon instance to compare to, or null if you want to use now()."