pegler / pytzwhere

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

all of China should be +0800, but some are showing up as +0600 #38

Open mikofski opened 7 years ago

mikofski commented 7 years ago

For example if I check Sichuan, China I get Asia/Urumqi at +0600, not China at +0800

from tzwhere import tzwhere
from datetime import datetime
import pytz

TZ = tzwhere.tzwhere(shapely=True, forceTZ=True)
JAN1 = datetime(2016,1,1)
JUN1 = datetime(2016,6,1)

# Sichuan, pvsim ID #1990489
tz.tzNameAt(29.45, 97.15)
pytz.timezone(tz.tzNameAt(29.45, 97.15))
sichuan = pytz.timezone(tz.tzNameAt(29.45, 97.15))
print sichuan
# Asia/Urumqi  <- this is the timezone

# method 1: strftime('%z'), this is used in HAL_db_migration
jan1 = sichuan.localize(JAN1)
tz_str = jan1.strftime('%z')
print tz_str
# '+0600'

see also mattbornski21

cstich commented 7 years ago

Can you elaborate why you think all of China should be +0800? In our source data, China does have several timezones.

mikofski commented 7 years ago

I don't know the history, but here is my evidence:

Sorry I can't be of more help - tzwhere is a great service. I have sent an email to Eric Muller.

mikofski commented 7 years ago

However, the IANA database says that there are 4 timezones!

evansiroky commented 7 years ago

Asia/Urumqi is a tricky one because technically both timezones are used in this area depending on what worldview you subscribe to.

cstich commented 7 years ago

@mikofski If you can report back what Eric Muller says that would be great.