UPDATE
I am dealing with a legacy database where the datetime values have been stored in a specific timezone (not UTC). Assume it is not possible to change how we are storing these values.
END UPDATE
Say I have a SQL Server 2005 database with a table as follows:
[id] (int) not null
[create_date] (datetime) not null
Suppose my [create_date] has been stored, by convention, as timezone TZ-A.
Suppose I want to retrieve this value (using SqlClient) from the database and display it in another timezone, TZ-B.
How do I do this?
DateTime from_db = // retrieve datetime from database, in timezone TZ-A
DateTime to_display = //convert from_db to another timezone, TZ-B
Use TimeZoneInfo
I also agree that storing in UTC is the way to go. The only downside is trying to explain UTC to users who want to write their own reports.