title: Parse date in ZF2
body: <p>I'm having a problem.</p>
  
  <p>I'm using ZF2, and getting an error here.</p>
  
  <pre><code>$inputFilter-&gt;add($factory-&gt;createInput(array(
      'name' =&gt; 'dataInicial',
      'required' =&gt; true,
      'validators' =&gt; array(
          array(
              'name' =&gt; 'NotEmpty',
              'options' =&gt; array(
                  'messages' =&gt; array(
                      \Zend\Validator\NotEmpty::IS_EMPTY =&gt; 'A data do feriado deve ser preenchida.'
                  )
              )
          ),
          array(
              'name' =&gt; 'callback',
              'options' =&gt; array(
                  'messages' =&gt; array(
                      \Zend\Validator\Callback::INVALID_CALLBACK =&gt; 'Data no formato inválido.'
                  ),
                  'callback' =&gt; function ($value, $context = array()) {
                          $dataInicial = \DateTime::createFromFormat('d/m/Y', $value);
                          return $dataInicial-&gt;format('d/m/Y');
                  }
              )
          )
      )
  )));
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre class="lang-php prettyprint-override"><code>DateTime::__construct(): Failed to parse time string (25/12/2014) at position 0 (2): Unexpected character
  </code></pre>
  
  <p>When I execute the same code in pure php, without zend, it works ok.</p>
  
  <pre class="lang-php prettyprint-override"><code>echo DateTime::createFromFormat('d/m/Y', '25/12/2014')-&gt;format('d/m/Y');
  </code></pre>
  
  <p>Maybe someone knows what's causing the error? Sorry for my english</p>