Face value date time on DatePicker to server

Thanks Aldo
I’ll put something together.

Here’s what’s happening:

  1. On the AnvilServer (UK?) I make a remote SQL request to our MSSQLServer (US??) for temperature vs datetime plot data for produce truck journeys and store them in the AnvilServer Anvil DB (so I can do Machine Learning on the AnvilServer without making hundreds of MSSQLServer calls later)
  2. On the AnvilServer I calculate ‘leg’ boundaries (ie start & stop datetimes) for different phases of each journey
  3. On the CLIENT (AUSTRALIA) I make request for a particular journey data and PLOT it in PLOTLY (temperature vs time)
  4. I get problems using the CLIENT datetime-pickers to select timeperiods to plot (ie wrong selection)
  5. I MIGHT be getting problems plotting color-coded journey-legs using datetime boundaries calculated on the server
  6. I get problems comparing sets of boundaries after a user changes them using another date-picker on the client.

All of this is caused by the inability of Anvil to allow me to have time-zone unaware datetimes since my data from a server in the US has nothing to do with the US! So, throughout my code sometimes need to correct for the timezone difference between Australia and the UK. I don’t think I’m getting a US timezone effect. I have TRIED to remove timezone info and failed 100 times.

What to you looks like the ‘right’ time on a datetime picker has secret timezone information in it. And I often can no longer keep track of which objects I calculated locally vs on the server.

It really is stupid because Anvil assumes that we want data relevant to the time-zone of the 3 computing devices involved when its about a journey that occurred at a FOURTH location UNRELATED to any of the computers, sometime in the past at an unspecified geo-location which in fact is changing during the journey because it’s a . . journey . . and in fact it’s a journey ACROSS time-zones!!

Remember, Anvil automatically converts timezone-unaware datetimes to timezone-aware datetimes when they are passed between client and server. I’ve tried to convert back to timezone-unaware but of course it changes the face-time value of the datetime from what it used to be UNLESS I actually correct it for the timezone difference by knowing where the browser is and where Anvil is.