All properties with type "date", "datetime", "timestamp" will be represented using a DateTimeImmutable object.

By default the ORM uses single DB specific timezone which can be configured on driver level, all dates selected from and stored into the database will be converted into UTC timezone.

DBAL will automatically convert any DateTimeInterface parameter into the appropriate timezone to ensure proper data selection.


You have to remember that ORM calculates entity difference based on column references, this means that you must only use immutable version of DateTime.

$user->created_at->setDate(...); // error, won't trigger an update

Proper way:

$user->created_at = new \DateTimeImmutable(...);
Edit this page