Open andreievg opened 6 months ago
@andreievg obvs I'm a bit of an outsider for this, I thought we'd use naivetime? Appears we do looking at the PR so I don't really see how this is different from datetime fields throughout the whole system? If they have a central server in the netherlands but the sync client is in the Pacific then š¤·.
If every store or every site had gps coordinates we could automatically show the right timezone based on that rather than using the OS timezone, I wonder if that idea has any legs.
how this is different from datetime fields throughout the whole system
When we enter a filter in omSupply, we expect that filter to be in OS timezone, so it is translated to OS timezone (browser would send that datetime filter with timezone offset), and back end would translate it to UTC as naive datetime and use that in the query.
For fridge tag, data in .txt
does not have timezone. Fridge tag file is processed on server when downloaded, how do we know which timezone it is in ? We should use timezone of OS which has the fridge tag plugged in, rather than timezone of the server receiving the fridge tag upload, and the one that is processing it.
Gotcha! Thanks that makes sense
What went wrong? š²
A carry over from issue https://github.com/msupply-foundation/open-msupply/issues/2690 and PR https://github.com/msupply-foundation/open-msupply/pull/3047 There was a fine print in that issue: `I've used something like this but just using server local datetime, but the client may not match the server.`, that might have been missed. In the PR we ended up using server timezone, which is ok for now, but would be problematic if client timezone is different to server. ## Expected behaviour š¤ Timezone form client is used rather then server for fridge tag date time offsets ## How to Reproduce šØ I haven't actually tried to reproduce. But the steps should be: Use a cloud server that has different timezone to your machine. Upload fridge tag data from https://github.com/msupply-foundation/temperature-sensor/blob/main/data/FridgeTag%202L/130500109088_202206081014.txt. Inspect data in UI and temperatures / datetimes should match ## Extra Not a very high priority ## Suggested solution Client will need to send it's timezone offset when upload fridge tag data, which is used as the offset in convert_from_localtime ## Your environment š±