How to change time zone for an asp.net application

Sorry there is no way in .NET to change the time zone globally.

The only way you have is to change the timezone of your server or rewrite all of your code.

The best practice is to not rely on the system time zone at all (never use DateTime.Now).

You should handle all date as Utc dates and then convert to a specific zone when displaying them to users.

Even if you manage to handle timezones in your ASP.NET application, there are still timezones on SQL Server, for example GETTIME funtion. If your application is entirely written in UTC, your SQL server function will work as well.

Leave a Comment