python datetime.astimezone behavior incorrect?
问题 Here is the code which first parses time from string in IST and then converts that to UTC. So when it 4:00 pm in India the time in GMT / UTC is 10:30 am. While the following code prints it as 9:30 pm. So instead of subtracting the offset it is adding the offset. From the python documentation https://docs.python.org/2/library/datetime.html#datetime.datetime.astimezone the sample implementation of astimezone, it does appear that it would add the offset if it is negative but it seems contrary to