Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving TimeZoneInfo class
Message
 
To
12/11/2008 11:21:18
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01361400
Message ID:
01361407
Views:
15
>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

The serialized object is pretty small. If you're using in-proc sessions, you could just save the TimeZoneInfo instance there since it will hold a live reference to it. If you're using out of proc. sessions, it really doesn't matter since in both cases you're serializing/deserializing the object.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Reply
Map
View

Click here to load this message in the networking platform