maxmind / GeoIP2-php

PHP API for GeoIP2 webservice client and database reader
https://maxmind.github.io/GeoIP2-php/
Apache License 2.0
2.33k stars 276 forks source link

Possible to get Timezone from country code ? #73

Closed Growiel closed 8 years ago

Growiel commented 8 years ago

Hello,

I have a country code and I need to get its timezone.

Most of the time, the country code comes from GeoIP and I can just use $reader->country($ip)->location->timeZone.

However sometimes the country code comes from the URL, using GeoIP1 I could get the timezone using get_time_zone() from timezone.php.

I've looked carefully through the docs and it seems like the only entry point is the IP now, having a country code does not allow me to lookup what I need to.

Did I miss something ?

oschwald commented 8 years ago

It is not possible to look up a time zone from a country with this library.