Answers for "carbon\exceptions\invalidformatexception: could not parse 'wed oct 27 2021 23:21:23 gmt+0530 (indian standard time)':"

PHP
0

laravel carbon Could not parse '28/09/2021, 12:00:00 pm': DateTime::__construct(): Failed to parse time string (28/09/2021, 12:00:00 pm) at position 0 (2): Unexpected character

Because Carbon does not understand d/m/Y format out of the box. If you use 
slashes it should be mm/dd/yyyy in that case. d/m/Y is not an official date 
format.

You can use :
{{ CarbonCarbon::createFromFormat('d/m/Y', $holiday->holiday_date)->format('d-m-Y') }}
Posted by: Guest on September-28-2021

Code answers related to "carbon\exceptions\invalidformatexception: could not parse 'wed oct 27 2021 23:21:23 gmt+0530 (indian standard time)':"

Browse Popular Code Answers by Language