Detecting timezone for client browser

  • Thread starter Thread starter NWx
  • Start date Start date
N

NWx

Hi,

I have an ASP.NET application, which allow users to add notifications, and
at the proper time they receive a notification e-mail.

However, users can be around the world

So I'd like to be able to detect timezone of a client (based on settings
from the PC the browser is run on), and adjust the notification time in
database appropriately.

Thank you
 
On your server, you should know the UTC (GMT) time. On the client, the
browser knows what the local time is. If you have some JavaScript on the
client that populates a hidden form field with the current (client) date and
time, when it posts back to the server, it's a relatively simple meatter of
DateTime arithmeetic to determine the difference in the time, which is what
you really need, rather than the time zone.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Note that this solution assumes (as you must) that the time on the PC is set
correctly. But you should warn the user that you're making that assumption.
 
Good point. A much harder alternative would be to do a WHOIS lookup on the
IP address of the client computer, and see what (if any) LatLong and/or
address data is registered for the IP or the Network that owns the IP.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Hi,
Good point. A much harder alternative would be to do a WHOIS lookup on the
IP address of the client computer, and see what (if any) LatLong and/or
address data is registered for the IP or the Network that owns the IP.

Thank you all for answers.

How can I perform a whios lookup from ASP.NET?

Thank you.
 
Back
Top