zendframework/zf2 — pull request #2273 by dmitrybelyakov (2012-08-30 16:28:41+00:00)
Title: Zend\I18n\View\Helper\DateFormat - Fallback to date.timezone instead of system timezone.

Fallback to date.timezone instead of system timezone.

If we do not explicitly set timezone on DateFormat, it passes null value as timezone to IntlDateFormatter, that should fallback to date.timezone but doesn't. So we better do it ourselves.

Here's a test to demonstrate the bug:

```php
//set timezone to UTC
ini_set('date.timezone', 'UTC');

$now = new \DateTime;
$now->setTimezone(new \DateTimeZone('UTC'));
$expected = $now->format('g:i A');

//format
$helper = $this->getLocator()->get('Zend\I18n\View\Helper\DateFormat');
$formatted = $helper->__invoke(
$now,
\IntlDateFormatter::NONE,
\IntlDateFormatter::SHORT,
'en_US'
);

$this->assertEquals($expected, $formatted);