Last post Mar 29, 2007 04:32 PM by Rasetti
Mar 23, 2007 01:07 AM|Rasetti|LINK
I think that a very common scenario for us developing ASP.NET 2.0 apps is the need to retrieve the Client date / time.
in the Globalization functionality.
Mar 24, 2007 06:06 PM|Sohnee|LINK
Not sure why you'd want to use that - who's computer is exactly right and why give that control to client-side?
Maybe use the IP address to adjust your server time. You can get an accurate enough location based on IP to offset your clock.
Mar 29, 2007 02:28 PM|AbsCoder|LINK
Well... how about this:
The user is visiting a page you built with a report of some sort. If you know the client time, you can display to the user the last time they refreshed the report.
Is it the correct time? Probable not, but it provided the proper time difference information to the time the user thinks it is.
Mar 29, 2007 04:32 PM|Rasetti|LINK
Yes, exactly, there are dozens of scenarios like that where you need to access client time. It doesn't matter how "accurate" it is. For the client point of view, it's going to be as accurate as they have their own machines clock.
Currently you have to resort to make the user select a TimeZone and have a look up table (I'm using the Sharepoint 3.0 TimeZone.xml now) with all the timezone info (names, daylight time,etc) and adjust the displayed time accordingly.
Even if the TimeZone database is built in in Windows , the .NET Framework doesn't expose any functionality to work with it, except some methods that apply only the server TimeZone.