when does `datetime.now(pytz_timezone)` fail?
问题 delorean docs show this way to get the current time in a given timezone using datetime: from datetime import datetime from pytz import timezone EST = "US/Eastern" UTC = "UTC" d = datetime.utcnow() utc = timezone(UTC) est = timezone(EST) d = utc.localize(d) d = est.normalize(EST) and compare it with the delorian-based code: from delorean import Delorean EST = "US/Eastern" d = Delorean(timezone=EST) I believe the datetime example should be written as: from datetime import datetime import pytz