How to get TimeZone from an IP?

Hello all,

I need to create an offset to GMT. Is there a way to get the time zone, from an IP? If so how? Any alternatives?

Thanks,
Tim

You’d have to look the IP address up in a database like https://db-ip.com/ to find the location. Once you have that you should be able to get the TimeZone from the framework using the country code.

Some providers offer an expensive REST API and others you can download the database from and look up locally directly.

Thanks Tim.
Tim

You might be better looking at Session.ClientTime which includes the users TimeZone.

3 Likes

That does assume that the user’s clock is set correctly however.

What is more likely, that the user’s clock is set correctly or the user’s IP is close to the timezone he is using?

If I use a VPN that connects to other timezone/country, will that affect your web application?

If I use Mexico timezone instead of Central Time for my computer (for work for example) the 1 hr difference in time will create a problem with your app?

Tim unfortunately did not mention whether or not there even was a Session context. Is there another way to get the client time in a REST API being built in the HandleURL event?

The time may be wrong, but the timezone is likely correct.

You should guess the timezone and also give the user a clear way to override it