title: How can I store a datetime property in TYPO3?
body: <p>I have created a simple form which handles an object <strong>person</strong> and this object owns the property <strong>birthDate</strong> which is of type datetime. </p>
  
  <p>Now I want to create a person and store this property, but if I try to submit the form the following error occurs: </p>
  
  <p><strong>The date "%s" was not recognized (for format "%s")</strong></p>
  
  <p>I have read some threads and a lot of them suggest to use an initialize action to handle this problem, but this is not working for me.</p>
  
  <p>Person:</p>
  
  <pre><code>class Person extends AbstractEntity
  {
      ...
  
      /**
       * Stores the birth date of a person
       * 
       * @var \DateTime
       * @validate NotEmpty, DateTime
       *
       */
      protected $birthDate = null;
  
      ...
  }
  </code></pre>
  
  <p>Fluid:</p>
  
  <pre><code>&lt;f:form action="send" method="post" enctype="multipart/form-data" name="person" object="{person}"&gt;
  ...
  &lt;fieldset&gt;
      &lt;f:render partial="FormErrors" arguments="{field: 'person.birthDate'}" /&gt;
      &lt;label class="required"&gt;Birthdate&lt;/label&gt;
      &lt;f:form.textfield
          type="date"
          placeholder="dd.mm.yyyy"
          property="birthDate"
      /&gt;
  &lt;/fieldset&gt;
  ...
  &lt;/f:form&gt;
  </code></pre>
  
  <p>My initialize action looks like the following:</p>
  
  <pre><code>public function initializeSendAction()
  {
      if (isset($this-&gt;arguments['person'])) {
          $this-&gt;arguments['person']-&gt;getPropertyMappingConfiguration()-&gt;forProperty('birthDate')-&gt;setTypeConverterOption(
              'TYPO3\\CMS\\Extbase\\Property\\TypeConverter\\DateTimeConverter',
              \TYPO3\CMS\Extbase\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT,
              'd.m.Y'
          );
      }
  }
  </code></pre>
  
  <p>and the send action looks like:</p>
  
  <pre><code>public function sendAction(\Fox\Example\Domain\Model\Person $person)
  {
      $this-&gt;personRepository-&gt;add($person);
      ...
  }
  </code></pre>
  
  <p>So there is nothing special, but it seems that my custom datetime format <strong>"d.m.Y"</strong> is not working and the property is of type string, any suggestions?</p>