I get "ZZ" as a country code when using pytz

I am using the App engine and I am trying to get the time zone from the request. However, when on the local host it always seems that ZZ is a country code, which is not a country in the pytz library.

This code:

country = self.request.headers['X-Appengine-Country']
logging.info(country)
tz = pytz.country_timezones(country)

causes this error:

return self.data[key.upper()]
KeyError: 'ZZ'

Thank you very much for your help

+4
source share
2 answers

I suggest you use the correct case for the request header names. E.g.X-AppEngine-Country

, Location , .. . . , , Google, Google .

.

+4

'ZZ' " "

, 1070 + 30a + b, a b - , A = 1, B = 2 .. , AA = 1101, AB = 1102, BA = 1131 ZZ = 1876.

+4

All Articles