Level 8
$date=Carbon::parse(your date);
$date->isToday();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How could i compare a date with format dd/mm/aaaa with a carbon date to determine if someones birthday is today?
@feniixx After applying the previous steps you can do something like:
$now = \Carbon\Carbon::now();
if($user->birthday->day == $now->day && $user->birthday->month == $now->month){
...
}
Please or to participate in this conversation.