From 3571f96251df08dd8a9dda3ec4e1fadf30d6c63d Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 10 Feb 2015 17:10:40 +0000 Subject: 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. --- perllib/Utils.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perllib/Utils.pm') 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; -- cgit v1.2.3