aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-04-25 17:09:31 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-05-02 22:07:26 +0100
commit54cad1e4d2474fba55485731ca9e2fd1779c524a (patch)
tree0b1e765b8bac8b50953038cf6ae25b1aa312e0d1 /perllib/FixMyStreet/App/Controller/Report.pm
parent4b4da81ffec527df9741c960d79294b48bb4dcaa (diff)
Fix some incorrect timezone code.
Times in the database should be stored in the application server's local timezone, by e.g. using `current_timestamp`, or by setting that timezone explicitly before storage (the database columns are all without timezone so any timezone info is silently ignored). Reports & updates fetched via Open311 and offline updates were being put into the TIME_ZONE setting if present, meaning they were stored incorrectly for future usage.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index e032caa09..7f798f4f4 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -534,7 +534,7 @@ sub inspect : Private {
# to have the FMS timezone so we need to add the timezone otherwise
# dates come back out the database at time +/- timezone offset.
$timestamp = DateTime->from_epoch(
- time_zone => FixMyStreet->time_zone || FixMyStreet->local_time_zone,
+ time_zone => FixMyStreet->local_time_zone,
epoch => $saved_at
);
}