DISCOOS / sarsys-app

SarSys Flutter app
7 stars 2 forks source link

DateTime is parsed as local time #132

Open Anders55 opened 3 years ago

Anders55 commented 3 years ago

When using DateTime.parse to read positions from JSON the timestamp is read as local time, not in UTC. This can cause errors when calculating effort etc.

image

The problem is related to this issue: https://github.com/dart-lang/sdk/issues/37420

Need better general handling to solve this, migt need to be handled in data layer and backend as well. One way might be to handle timestamp without Z as UTC. This could be defined in the API. The app should do the same when data is created offline.