pegler / pytzwhere

python library to look up timezone from lat lng offline
Other
146 stars 54 forks source link

No timezone for Dubai #55

Open iDevo opened 3 years ago

iDevo commented 3 years ago

Hi there, I am trying to retrieve the timezone for coordinates in Dubai (25.193, 55.309) using these lines of code:

from tzwhere import tzwhere
tz = tzwhere.tzwhere()
tzName = tz.tzNameAt(25.193, 55.309)

Unfortunately None is being returned to me but the correct timezone would be "Asia/Dubai".

Is someone else able to reproduce this behavior? Thanks!

kovar-ursa commented 2 years ago

You need to use forceTZ=True.

tz = tzwhere.tzwhere(forceTZ=True)
timezone = tz.tzNameAt(25.193, 55.309, forceTZ=True)
print (timezone)
Asia/Dubai