zendframework/zf2 — pull request #6198 by ojhaujjwal (2014-04-26 07:20:10+00:00)
Title: Created DateTime Formater strategy for hydrator

## Use Case:
Here's is an example:
```php
class User
{
protected $registrationDate;

public function setRegistrationDate(DateTime $registrationDate)
{
$this-> registrationDate = $registrationDate;

return $this;
}

public function getRegistrationDate()
{
return $this->registrationDate;
}
}

$user = new User;

$hydrator = new Zend\Stdlib\Hydrator\ClassMethods;
$strategy = new Zend\Stdlib\Hydrator\Strategy\DateTimeFormaterStrategy('Y-m-d');
$hydrator->addStrategy('registration_date', $strategy);
$hydrator->hydrate(array('registration_date' => '2014-04-26'), $user);

echo $user->getRegistrationDate()->format('Y-m-d'); // will print 2014-04-26
echo $hydrator->extract($user)['registration_date']; // will print 2014-04-26
```