Ubuntu – How does the install process guess the timezone

installationtimezone

Is it possible to use the same tool to have Ubuntu guess what timezone it is currently in?

This article mentions the feature I'm looking for (just above the second pic):
http://www.linuxforu.com/2012/05/ubuntu-12-04-precise-pangolin-review/

Best Answer

Ubuntu uses the ubuntu-geoip package, which queries http://geoip.ubuntu.com/.

You can python-geoip to achieve the same thing:

import GeoIP
geo = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE)
ip = '200.100.50.0'
print geo.country_code_by_addr(ip)

Sadly, it doesn't work with ipv6 yet.

Related Question