title: Symfony Serialize Entity with Datetime / Deserialize fails
body: <p>Im trying to save an Entity as a json file. The entity class also includes a datetime field:</p>
  <pre><code>class Ear
  {
  ...
      /**
       * @ORM\Column(type=&quot;date&quot;)
       */
      private $date;
  ...
  }
  </code></pre>
  <p>Then I create a new Ear:</p>
  <pre><code>$earLine = new Ear();
  $earLine-&gt;setDate(new \DateTime());
  </code></pre>
  <p>Now I simply would think I can normalize and serialize this object:</p>
  <pre><code>$encoders = [new JsonEncoder()];
  $normalizers = [new DateTimeNormalizer(), new ObjectNormalizer()];
  $serializer = new Serializer($normalizers, $encoders);
  
  $json = $serializer-&gt;serialize($earLine, 'json');
  </code></pre>
  <p>which works fine. The json looks like this:</p>
  <pre><code>{
    &quot;id&quot;: null,
    &quot;date&quot;: &quot;2021-05-31T00:00:00+02:00&quot;,
    ...
  }
  </code></pre>
  <p>However upon trying to deserialize, it fails to <strong>denormalize the datetime</strong>.</p>
  <pre><code>$encoders = [new JsonEncoder()];
  $normalizers = [new DateTimeNormalizer(), new ObjectNormalizer()];
  $serializer = new Serializer($normalizers, $encoders);
  
  dd($serializer-&gt;deserialize($json, Ear::class, 'json'));
  </code></pre>
  <p>with the error <code>Failed to denormalize attribute &quot;date&quot; value for class &quot;App\Entity\Ear&quot;: Expected argument of type &quot;DateTimeInterface&quot;, &quot;string&quot; given at property path &quot;date&quot;.</code></p>
  <p>I read the docs up and down and search stackoverflow. But it fails for not apparent reason, at least not for me.</p>
  <p>Using Symfony 5.3.</p>