Closed takluyver closed 5 years ago
My suspicion is that we're storing the datetimes as floats, so "#{datetime}UTC"
is expanded to something like "20180501104904.0UTC"
(note the decimal point).
In the coordinate table view, the code to parse the datetimes looks like this:
Time.strptime(((coordinate.datetime.to_f).round).to_s+"UTC", "%Y%m%d%H%M%S%z")
I guess that .round
will convert the float to an integer. The simple fix would be to copy this for the other datetime parsing code.
Longer term we should presumably store datetimes as datetimes.
fixed on master and deployed, right now.
:+1: thanks!
Accessing e.g. http://167.99.205.49/missions/2/latest_coordinates?limit=10
The error in the logs is:
Relevant line seems to be here: https://github.com/WRSC/tracking/blob/2458d2a75c126f4f1fc646726fb8f9faa2a5c8d8/MYR_rails/app/models/coordinate.rb#L24
I'm not sure what's invalid about that format.