This is not a problem at all, because the server-local time zone is known from the OS. See the class
System.TimeZoneInfo
,
http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx[
^].
On the client side, time zone is known from JavaScript API, see
http://www.w3schools.com/jsref/jsref_gettimezoneoffset.asp[
^].
I would prefer another approach: do all your calculations in all the application using only UTC time, which by definition is the same for any place on the Globe. Use
System.DateTime.UtcNow
. Of course, for the users it's convenient to use their local time. Use it only at the moment when you need to show time in HTML; convert UTC time to local time using JavaScript as I mentioned above.
That's it.
—SA