Avatar of Marc Rosema
Marc Rosema
 asked on

asp.net time zone settings

I want to let the end user choose their time zone and store this in to a database or web.config and use this setting throughout the application for setting the creation time to their time in stead of the servers time the application is running on.

How  can do this the best way?
ASP.NET.NET ProgrammingC#

Avatar of undefined
Last Comment
Paul MacDonald

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ryan Chong

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Shaun Kline

If your application will be used by multiple people across multiple time zones, and those people can view data from all users, this is not a wise idea, as it will skew the times seen by these other people. It is better to store your dates using the server time and use ASP.Net to localize the dates for the person viewing the information.

This link from Microsoft's website provides information on how to do this: https://msdn.microsoft.com/en-us/library/w7x1y988(v=vs.110).aspx
Paul MacDonald

You can ask the client for their timezone and store that.  I would store all events with a timestamp set to GMT/UCT, then adjust the timestamp by the client's offset when you're showing it to the client.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck