I have a multi-timezone web application that stores all of the datetime values in UTC in the database, when actions happen on the server, I can easily convert the time into UTC.
However, when a client enters a time or time span, what is the best way to detect and store it?
I am currently doing the following:
- Get the value of Date.getTimezoneOffset() (javascript)
- Post that to the server-side code via the ICallbackEventHandler on Page.
- Store that value in the session
- On any subsequent request, calculate the output/input datetime value using the client's timezone.
Regardless of the actual implementation, this seems like an in-elegant solution. Does anyone have a better method?