DataTime over different timezones.

  • Updated

A customer runs a website which is hosted on Azure. For example West Europe (The Netherlands), this is also where the company is located. Now their question: When they enter a date in the Cms the date on the website is shown with a 2 hour difference. How do you fix the 2 hour difference issue?

Try to set the timezone of the webapp to the same timezone the company is in. They can set it under application settings in azure: WEBSITE_TIME_ZONE and then they set the time zone they want.

If there are multiple users across the world that's using the site you could try and implement something that could predict the time zone of visitors through the use of custom code. The following gives some feedback on how you may go about this.

https://stackoverflow.com/questions/44965545/best-practices-with-saving-datetime-timezone-info-in-database-when-data-is-dep