Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / database / SQL-Server

How to convert UTC time to Local Time

4.67/5 (3 votes)
3 Jan 2012CPOL 32.4K  
In my opinion, Local to UTC time conversion should be done nearer to UI level. That is, you should pass UTC time to your query and the time should be converted later when it is displayed to the user.Doing the conversion in code will simplify SQL queries and thus probably improve overall...
In my opinion, Local to UTC time conversion should be done nearer to UI level. That is, you should pass UTC time to your query and the time should be converted later when it is displayed to the user.

Doing the conversion in code will simplify SQL queries and thus probably improve overall performance. Also, it would be much more easier to allows the user to select which time zone to use. Most of the time, the time zone is only a display property and all the logic is done with UTC time.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)