aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App
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/FixMyStreet/App
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/FixMyStreet/App')
-rw-r--r--perllib/FixMyStreet/App/Controller/Dashboard.pm2
1 files changed, 1 insertions, 1 deletions
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 ) ) ] );