Question Can you solve the timezone mystery?

paulray

New member
Joined
Jan 22, 2022
Messages
1
Programming Experience
10+
At what point is the determination of time zone selection made when displaying datetime values?
Ok, follow me through this please, the following results from tests conducted in the EST time zone.
I am accessing VFPRO data stored on a server in a location with a time zone of Eastern Daylight Savings Time. or EST (UTC -5)
This server also hosts an MSSQL instance., as well as an API that I created to pull data directly from the DBC files (using vfpoledb), bypassing MSSQL.
I am hosting a web application that is hosted in 2 locations, 1 in a time zone of EST and 1 in a time zone of MST (Mountain Savings time UTC-7)
Here's the mystery;
1) If I access the data from the EST web site via a view through the MSSQL instance, I will get the datetime in EST format: 12/31/2021 12:00:00 AM (but not efficient)
2) If I access the data from the MST web site via a view through the MSSQL instance, I will get the datetime in EST format 12/31/2021 12:00:00 AM (but not efficient)
3) If I access the data from the EST website via the EST hosted API, I will get the datetime in EST format: 12/31/2021 12:00:00 AM (very efficient)
BUT
4) If I access the data from the MST website via the EST hosted API. I will get the datetime in MST format: 12/30/2021 09:00:00PM
.
I am not clear why #2 and #4 would give different results. My preference is to pull the data via the route of #4 but display in Local time zone format.
I have tried numerous ways of manipulating ASP.NET functions to change the display while the data is being bound to the page, but the display always goes back to MST time when rendered.
Can anyone point me in the right direction to solve this?
Thanks for your input.
 
Top Bottom