merged branch andrewjbaker/force-timezone (PR #964)
authorFabien Potencier <fabien.potencier@gmail.com>
Fri, 8 Feb 2013 19:01:59 +0000 (20:01 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Fri, 8 Feb 2013 19:01:59 +0000 (20:01 +0100)
This PR was merged into the master branch.

Commits
-------

999b1c4 Force timezone setting in date filter

Discussion
----------

Force timezone setting in date filter

In instances where the $time parameter to the DateTime ctor includes a timezone, the $timezone argument is ignored. This functionality extends to the date filter.

http://uk3.php.net/manual/en/datetime.construct.php

"The $timezone parameter and the current timezone are ignored when the $time parameter either is a UNIX timestamp (e.g. @946684800) or specifies a timezone (e.g. 2010-01-28T15:00:00+02:00)."

Accepting this pull request is dependent on whether the desired functionality of the date filter should honour the PHP way of doing things, or the more logical and natural functionality anticipated by a Twig template designer; always ensuring the timezone passed into the date filter is applied.

1  2 
lib/Twig/Extension/Core.php

Simple merge