Strangest thing today, I make a doctrine request to get an Order from a precise date. But when I dump the date, I get a different date than the one in the database, I get the day after.
From doctrine, with my request $order = $em->getRepository(Order::class)->findOrderByDate() I get the order I want. I double check in the database, the order ID has the good date 16-12-2022.
But then if I dump my order date, dump($order->getDate()) I get the following date 17-12-2022.
DateTime @1671274800 {#1248 date: 2022-12-17 12:00:00.0 Europe/Berlin (+01:00) }
If I manually change the time in the database, I still get the wrong date, but the time is correctly changed. (That would confirm that I interact with the right object)
I am on php 8.1.13, symfony 6.1.8.
The issue is the same on my PC or in the prod server.
What is happening here ?
Thanks a lot