Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving TimeZoneInfo class
Message
From
12/11/2008 11:21:18
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Saving TimeZoneInfo class
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01361400
Message ID:
01361400
Views:
71
Ok, I have been asking lots about this TimeZone issue but I think I have it mostly figured out.

All my data is now stored in the SQL database as UTC time. I am storing a string "Pacific Standard Time" for instance in the database for the company the user logs in as. Upon login I am thinking about saving in the session the string for the timezone so I can use it to convert all the dateTime values when they are displayed. I am also displaying on the pages the TimeZone used. Because creating a TimeZoneInfo object would generally be created by retrieving this from the registry and this is on a web server I have saved a TimeZone.xml file on the web server that has only the TimeZones I am interested in. TimeZoneInfo can be obtained with TimeZoneInfo.FromSerializedString("Pacific Standard Time") and this is what I will do.

My question is how should I save the TimeZoneInfo for the current user? Should I create it with the FromSerializedString with every page hit or would it be best to store the object in the session? I am not sure how big it is, and once in the users session I would save lots of time I would think.

Thanks for any thoughts.
Tim
Timothy Bryan
Next
Reply
Map
View

Click here to load this message in the networking platform