Closed Timisorean closed 6 months ago
Hello, since Carbon 3, you need to choose between:
Checking if a date is today/current day so no argument is needed as it's unambigous:
Carbon::parse('2018-06-01')->isToday()
Carbon::parse('2018-06-01')->isCurrentDay()
Or comparing 2 dates and see if they both are on the same day, in this case it's required (for explicitly) to clearly state the 2 dates:
Carbon::parse('2018-06-01')->isSameDay('2024-05-19')
The argument can be a date string, DateTime, or Carbon object.
Thanks.
Hello,
I encountered an issue with the following code:
Carbon version: v3.3.1
PHP version: v8.1.3
Error:
But it works when passing
Carbon::now()
as first argument. Cannot passnull
or leave out like doc say:Worked in Carbon v2.
Thanks!