python - Wrong aware-datetime with pytz and 'America/Chicago' -
this question has answer here:
in [57]: datetime.datetime(2015,7,7,15,30,tzinfo=pytz.timezone('america/chicago')) out[57]: datetime.datetime(2015, 7, 7, 15, 30, tzinfo=<dsttzinfo 'america/chicago' cst-1 day, 18:00:00 std>)
notice offset, saying utc-6 (e.g -(24-18) ) while correct offset chicago on 2015-7-7 utc-5.
am missing here?
there issues timezones , pytz using localise fix:
import pytz d = datetime(2015,7,7,15,30) dt = pytz.timezone('america/chicago').localize(d) print(dt) 2015-07-07 15:30:00-05:00
Comments
Post a Comment