diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-02-10 17:10:40 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2015-02-13 10:09:33 +0000 |
commit | 3571f96251df08dd8a9dda3ec4e1fadf30d6c63d (patch) | |
tree | 6cd0d05d06a51dfdcbe183c4c10b38c0a15c6231 /perllib/Utils.pm | |
parent | 9591ba909210b2a628237074b54e5eb3c6536856 (diff) |
Create timezone objects only once at startup.
Cache a DateTime::TimeZone::Local object, so that in an environment
where /etc/localtime is a copy of a timezone file, we don't repeatedly
walk all the timezone files to find the matching one.
Diffstat (limited to 'perllib/Utils.pm')
-rw-r--r-- | perllib/Utils.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/Utils.pm b/perllib/Utils.pm index 7f95d1f5a..87e0bd7c9 100644 --- a/perllib/Utils.pm +++ b/perllib/Utils.pm @@ -225,7 +225,7 @@ sub prettify_dt { $type ||= ''; $type = 'short' if $type eq '1'; - my $now = DateTime->now( time_zone => FixMyStreet->config('TIME_ZONE') || 'local' ); + my $now = DateTime->now( time_zone => FixMyStreet->time_zone || FixMyStreet->local_time_zone ); my $tt = ''; return "[unknown time]" unless ref $dt; |