I have this symfony4.3 (latest) PHP application and I am trying to insert to the database using Doctrine ORM and I need to insert the time which this query happened but I need a specific timezone and the timezone is not changing using either the date_default_timezone_set() or setTimeZone()
$entityManager = $this->getDoctrine()->getManager();
date_default_timezone_set("America/Bahia");
$customer = new Customer();
$customer->setName($name);
$customer->setPhone($phone);
$dt = new \DateTimeImmutable(date('m/d/y G:i:s'));
$tz = new \DateTimeZone("America/Bahia");
$dt->setTimezone($tz);
$customer->setCreated($dt);
I expect the timezone in the created cell to be changed to America/Bahia
Actual Output : Europe/Helsinki which is the timezone of the server