aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Utils.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-02-10 17:10:40 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2015-02-13 10:09:33 +0000
commit3571f96251df08dd8a9dda3ec4e1fadf30d6c63d (patch)
tree6cd0d05d06a51dfdcbe183c4c10b38c0a15c6231 /perllib/Utils.pm
parent9591ba909210b2a628237074b54e5eb3c6536856 (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.pm2
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;