Try this instead:
'birth_date' => Carbon::createFromFormat('d-m-Y', $request->birth_date)->format('Y-m-d'),
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello guys,
I'm having a problem with date submitting from a form. It's caused by the way safari os handles the datepicker. I don't know exactly what causing this, so finding a solution is a bit hard if you don't know where to look for.
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: '20-02-2012' for column 'birth_date' at row 1
i have tried to fixed it but with no success.
'birth_date' => Carbon::parse($request->birth_date)->format('Y-m-d'),
Please or to participate in this conversation.