I question if you really need local client time, ever. Well, you usually need this time just to present the time of some events translated into the client's local time zone, this is the only reasonable task. But this is time zone information, not really time itself. The server does not need anything about local time. Think about it in this way: you need to show time of some events. All events which happen happen in interaction with the server; and the server knows its local time, which should be got using
System.DateTime.UtcNow
, see
http://msdn.microsoft.com/en-us/library/system.datetime.utcnow.aspx[
^]. The time of anything else simply does not exist for the application.
On client side, you can use JavaScript method
Date.getTimezoneOffset
to translate UTC time into local time, see
http://www.w3schools.com/jsref/jsref_gettimezoneoffset.asp[
^].
Normally, that's all you really need.
—SA