zendframework/zf2 — pull request #5340 by mpalourdio (2013-10-24 13:05:32+00:00)
Title: fix Invalid date string provided because of wrong \DateTime formatting

When submitting french formatted dates with a Date form element and so, a custom format (d/m/Y), DateTimeFormatter fails because of wrong date formatting.

example :
```php
$this->add(
array(
'name' => 'mydate',
'type' => 'date',
'attributes' => array(
'id' => 'mydate',
),
'options' => array(
'format'=>'d/m/Y'
),
)
);
```

Trying to validate 31/01/2013 fails with 'Invalid date string provided'

```php
$value->format($this->format);
```
When the value is a string, we must consider using DateTime::CreateFromFormat() to format the date accordingly to the format that is set in the form element.
When the value is an int (timestamp), the format ->format() method can be used