I have ExpireDate
, NowTime
fields in my table like example:
Expire Date : 2020-05-11 00:00:00
NowTime : 2020-05-13 00:00:00
I want to get to the difference between the two dates (NowTime
- ExpireDate
) and use this code:
$diff=Carbon::now()->diffInDays($row->expire_date);
The problem is that if there are two days left until the expiration date, Carbon return 2, Also, if 2 days have passed since the date Carbon return 2
How can I detect if it's 2 days left or 2 days passed of date?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire