Carbon
Carbon copied to clipboard
diffForHumans gives wrong amount of days
Hello,
I encountered an issue with the following code:
$deletedDate = Carbon::now()->startOfDay()->addDays(31);
echo $deletedDate->diffForHumans(Carbon::now()->startOfDay(), [
'syntax' => CarbonInterface::DIFF_ABSOLUTE,
'skip' => ['m', 'w'],
'minimumUnit' => 'd'
]);;
Carbon version: 2.61.0
PHP version: 8.1.8
I expected to get:
31 days
But I actually get:
28 days
Thanks!