示例代码
from datetime import datetime, timezone
import pytz
tzstring = 'Europe/Berlin'
t1 = datetime(2016, 6, 16, 2, 0, tzinfo=pytz.timezone(tzstring))
t2 = datetime(2016, 6, 16, 2, 0, tzinfo=timezone.utc).astimezone(pytz.timezone(tzstring))
观察
print(t1): 2016-06-16 02:00:00+00:53
print(t2): 2016-06-16 04:00:00+02:00
预期
print(t1): 2016-06-16 04:00:00+02:00 # does not match expectation
print(t2): 2016-06-16 04:00:00+02:00 # matches expectation
问题
谁能给我解释一下吗?
其他问题: