Ich bekomme folgende Ausgabe. Ist das das beabsichtigte Verhalten von Pytz? Ich lebe übrigens in der US/Eastern Zeitzone. Warum gibt EST -04: 56 als Zeitzone Offset?pytz und datetime seltsames Verhalten - möglicher Fehler?
import datetime
import pytz
a = datetime.datetime.now()
tz_est = pytz.timezone("US/Eastern")
a = a.replace(tzinfo=tz_est)
print("EST")
print(a)
print("\n")
b = datetime.datetime.now(pytz.timezone("US/Pacific"))
print("PST - version 1")
print(b)
print("\n")
tz_pst = pytz.timezone('US/Pacific')
c = tz_pst.normalize(a)
print("PST - version 2")
print(c)
print("\n")
EST 2017.03.16 22: 52: 27,616000-04: 56
PST - Version 1 2017.03.16 19: 52: 27,617000-07: 00
PST - Version 2 2017.03.16 20: 48: 27,616000-07: 00
Mögliches Duplikat [Zeitzonenfeld in isoformat] (http://stackoverflow.com/questions/26264897/time- Zonenfeld-in-Isoformat) – DyZ