Best way to get user timezone based on area code

I am trying to get the user's time zone based on the code code information that they provided. I found the following maxmind resource:

http://geolite.maxmind.com/download/geoip/api/php/timezone/

I suspect that I can use this with another api that provides the state to which the area code belongs. I am looking for a simple REST API that provides this information - or a reliable cleaning procedure that achieves the same results.

Thanks in advance!

+3
source share
3 answers

. ( 18 30 ) . , - . Google , !

+5

If you're fine with adding Javascript to your project, then you can try ChronoMouse.js , which will help you get the current time, GMT offset, time zone name, location, capital, daylight saving laws or daylight saving time status for any code in the USA / Canada or country code.

For country codes, information is based on the capital.

For instance:

console.log( getLocalInfo('+49').time.display );

// 15:07

See www.chronomouse.com for more examples and documentation .

Note. I am the author of the project.

0
source

Source: https://habr.com/ru/post/1740792/


All Articles