I have an ASP.NET application that is hosted in timezone A and is being used by users in timezone B. Is there any way to set the whole web application’s timezone to B even though the hosting environment is in A? I’ve already set the globalization tag in web.config with appropriate uiCulture and culture values and they work great for days of the week and other localization settings, unfortunately they did not adjust the clock :/ What is the easiest thing I can do to achieve the adjustment so when in the application i do DataTime.Now, I get the current time in timezone B not A. Thx.
Share
Assuming you have permission to make this change:
Set the machine’s time zone to be B would be my suggestion assuming that all the users of the application are sharing the same time zone.
Otherwise:
Store the offset for timezone B from Utc and use that combination though this may run into issues around daylight savings time possibly.