Is there any easiest way to calculate remaining days to birthady?
there is a similar question:
Days remaining before birthday in php
but I want to use Carbon
library.
like: 1989-6-30
update
function getDifferenceTwoDate($date)
{
$birthday = Carbon::parse($date);
$birthday->year(date('Y'));
return Carbon::now()->diffInDays($birthday, false);
}
getDifferenceTwoDate('1989-6-30')
but it returns 0
and
getDifferenceTwoDate('1991-5-22')
but it return -38