If I construct a Python date, and then place it in a pytz timezone
, it behaves as expected.
x = datetime.datetime(2015,1,1,10)
z = pytz.timezone('America/Chicago')
z.localize(x)
datetime.datetime(2015, 1, 1, 10, 0, tzinfo=< DstTzInfo 'America/Chicago' CST-1 day, 18:00:00 STD >)
If I construct a Python date using a pytz timezone
as a parameter, it does not, it is (presumably) a 'sun' time with an offset for the cities distance from the time zone border.
datetime.datetime(2015,1,1,10,tzinfo=tz)
datetime.datetime(2015, 1, 1, 10, 0, tzinfo=< DstTzInfo 'America/Chicago' LMT-1 day, 18:09:00 STD >)
Is there something I can do to the date or to the timezone itself so that it behaves the same in both contexts?