Make the AMF getway_old call parse times as UTC
Although it's not entirely clear how to interpret a timestamp from a client the production servers have effectively been parsing them as UTC because they run in the UTC time zone all year. Using Time.zone to do the parse forces it to happen in the rails time zone rather than the system time zone, which defaults to UTC as well. Fixes #1688
This commit is contained in:
parent
1045b405ae
commit
fe2e215d14
1 changed files with 1 additions and 1 deletions
|
@ -375,7 +375,7 @@ class AmfController < ApplicationController
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
# revert
|
# revert
|
||||||
timestamp = Time.strptime(timestamp.to_s, "%d %b %Y, %H:%M:%S")
|
timestamp = Time.zone.strptime(timestamp.to_s, "%d %b %Y, %H:%M:%S")
|
||||||
old_way = OldWay.where("way_id = ? AND timestamp <= ?", id, timestamp).unredacted.order("timestamp DESC").first
|
old_way = OldWay.where("way_id = ? AND timestamp <= ?", id, timestamp).unredacted.order("timestamp DESC").first
|
||||||
unless old_way.nil?
|
unless old_way.nil?
|
||||||
if old_way.visible
|
if old_way.visible
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue