How to handle daylight savings and timezone offset values
I am trying to display timestamp in local time where the asset is located (local time = asset time). I try to do this by
1. storing the local time in UTC time (server time) on the server (no offset)
2. get the timezone offset using the user's IP (user is person viewing the mashup)
3. add the timezone offset to the startDate and endDate of the query
4. subtract the timestamp value by the timezone offset value to display the data in the grid in asset time
This works great except the part when there was a daylight savings adjustment in the past.
Please see image below:
All of these records were restored with 00:00:00 for time, but you can see that the time shifted by 1 hour when daylight savings started on March 8th, 2020 in the US. When I use the timezone offset in step #2, I am using the current offset, which is -7. When I apply this to the query, it is applying it to all records even though some records need offset of -8 due to daylight savings adjustment. I can't get and apply historical timezone offset values.
How can I fix this?????

