dmitryme / erlang_localtime

Erlang library for conversion from one local time to another
Apache License 2.0
57 stars 51 forks source link

country to timezone lookup #5

Open coolchevy opened 11 years ago

coolchevy commented 11 years ago

May be you add country to timezone lookup by geoip

my list here https://gist.github.com/coolchevy/5004029

I use it for auto set timezone to clients on my site.

commented which not presents in your tz_database

Thank you for your project!

dmitryme commented 11 years ago

Hello, don't know what is geoip at all :). (detect placement by IP?). Some services by IP address return pair {"US"(or something), <some 2 symbol tag>}. Is it corrent? How did you get you list? Is it possible to get this information automatically?

coolchevy commented 11 years ago

Hi!

don't know what is geoip at all :). (detect placement by IP?).

yes

Some services by IP address return pair {"US"(or something), }. Is it corrent?

yes, It is by REST API or lookup from local database for example http://www.maxmind.com/en/geolocation_landing http://ru.smart-ip.net/geoip-api http://geoip.pidgets.com/ http://freegeoip.net/static/index.html http://wiki.nginx.org/HttpGeoipModule

How did you get you list? Is it possible to get this information automatically?

you can get country code by ip via many geoip services. Most popular is maxmind

my suggestion is using database from maxmind (or your own database) http://dev.maxmind.com/static/csv/codes/time_zone.csv to resolve timezone by country code from geoip service

https://gist.github.com/coolchevy/5004029