I have a simple tool that allows an employee to enter the ItemID of the work item they are working on and track the time it takes them to complete it. There is a Begin and End button which creates a timestamp in the database.
Since we have users all over the world that use this, we want to provide a more unique user experience in some areas which is where my question comes into play.
I currently store the timestamp as a Datetime type in the MSSQL Database. The timestamp is GETUTCDATE() which keeps everything consistent no matter where the user is actually located.
What I am now wanting to do is create a user setting that allows them to choose a timezone they want use when viewing the data on the site. For example, although everything is stored in the UTC timezone, a user can set their preference to Mountain Standard Time.
I then want to show all of that data in that timezone. When the user visits the site, we find out what timezone they want to view the data in. Based on that timezone, we show all the start and stop times accordingly.
Here is my question:
What should I be saving in the database as the users "preferred timezone"? Is this an integer (offset of hours) or is this an actual timezone name that I can use to determine the difference?
Second question is: How can I go about using this preference to alter the time and show it based on that users preference? Should this be done in the query or is there a front end plugin I can pass the UTC time and timezone preference to in order to show it?