Closed timdev closed 7 years ago
Just wondering what the use case is for this. By default Twig uses the default timezone from php.ini. When changing this for Twig only, you make it sort of out of sync with the rest of the application which uses the php.ini setting.
If you want to set it for users from different countries wouldn't it be better to write middleware and detect the locale and / or location and inject it into Twig afterwards.
My use case is an internal app for an organization that happens to operate in a single timezone. I stopped having anything other than 'UTC' in /etc/timezeone, php.ini or my.cnf a long time ago. To me, non-UTC timezones are just part of the date format. This seemed like the most sensible way to meet that requirement, which I imagine isn't uncommon.
Targeting 1.2.0, as it provides new features.
Thanks, @timdev! Merged to develop for release with 1.2.0
This adds support for configuring twig's default timezone via configuration.