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/FixMyStreet/App/Controller/Dashboard.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/App/Controller/Dashboard.pm') diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index 25c6e1923..c2b0a2ee2 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -128,7 +128,7 @@ sub index : Path : Args(0) { my $dtf = $c->model('DB')->storage->datetime_parser; my %counts; - my $now = DateTime->now( time_zone => 'local' ); + my $now = DateTime->now( time_zone => FixMyStreet->local_time_zone ); my $t = $now->clone->truncate( to => 'day' ); $counts{wtd} = $c->forward( 'updates_search', [ $dtf->format_datetime( $t->clone->subtract( days => $t->dow - 1 ) ) ] ); -- cgit v1.2.3