How to format date getting through Vuejs Datepicker in laravel

I am Vuejs application in Vuejs with Laravel as a backend. I use datepicker to add dates in a column. I get an error

Invalid date and time format: 1292 Invalid date and time value: '2017-05-04T18: 30: 00.000Z' for the column schedule in row 1

I am sending the date on request:

enter image description here

And when doing dd in laravel, I get:

enter image description here

Can anyone help me how to achieve this.

0
source share
1 answer

You can use Carbon to analyze the date and format it.

 $mydate = '2017-05-04T18:30:00.000Z'; // $request->schedule $parsed_date = Carbon\Carbon::parse($mydate)->toDateTimeString(); 
+2
source

Source: https://habr.com/ru/post/1269587/


All Articles