Thanks for your reply Joao!
Problem I foresee with this solution is that we use the datetimes in an Highchart.
In that context, we want to keep the datetime type so Highcharts work correctly.
Another solution we came up with, is converting the datetimes on the backend to compensate for the difference in timezone of the client.
So for example
- UTC: April 2nd, 2021 at 14:00
- User: in timezone +02:00
- Location: in timezone -05:00
On default this date would be shown as 16:00 to the user in +02:00.
But what we actually want is to show it as 09:00 to the user, based on the location of -05:00.
The difference between client and location (in total 07:00) can be subtracted from the UTC time. The new "UTC" time will be: 14:00 - 07:00 = 07:00.
If you have a UTC of 07:00, to the client in timezone +02:00 this will be shown as 09:00.
And that would be what we want as time of the location.
The one thing to get this working properly, is retrieving the client timezone settings correctly.