Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Stelikas's avatar

Date changes when posting date to controller from Vue

I'm trying to save a date in a database, I'm posting the correct value which for example is Thu Oct 13 2022 15:00:00 GMT+0300 (Eastern European Summer Time) and then, the date that gets passed to the controller converts to 2022-10-13T12:00:00.000Z this is obviously a timezone issue, although in app.php the timezone i have set is 'timezone' => 'Europe/Athens' which is correct and it is GMT +3, what could the issue be?

0 likes
1 reply
vincent15000's avatar

It's normal that the code stores the dates in this format. Then your locale will transform the date to have the local date from the GMT date.

If you really need to save the selected date (in your example Thu Oct 13 2022 15:00:00), you need to use this format : 2022-10-13 15:00:00.

Please or to participate in this conversation.