I have a User entity:
use Doctrine\\ORM\\Mapping as ORM; /** * ExampleBundle\\Entity\\User * * @ORM\\Entity()
Consider using DateTimeImmutable class for your date/time properties. Thereby, note that DateTimeImmutable is not an instance of DateTime.