mattbornski / tzwhere

Determine timezone from lat/long in NodeJS
Other
105 stars 71 forks source link

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

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'
mikofski commented 7 years ago

See also pegler38.

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.