I have a json with date of users. Dates can be format:
"bdate": "25.10",
"bdate": "8.7.1990"
"bdate": "13.10.1984"
"bdate": "7.3"
How I can parse these dates in carbon globally?
When I use:
Carbon::parse($people->bdate)
I get error:
DateTime::__construct(): Failed to parse time string (25.10) at position 0 (2): Unexpected character
"bdate": "25.10",what does that format mean, I mean how would you convert that to a normal date?Carbon::parsecant either.\Carbon\Carbon::createFromFormat('d.m', $date)->day;though it needs some work around to match all of your case