My problem is similar to this question, but doing the timedelta on UTC datetimes is not an option for me.
I have a function that evaluates a period every 'human day', so midnight-to-midnight. That means that in the UK for example, there are two days with 23 and 25 hours respectively. It works something like this:
import datetime
import pytz
start_dt = datetime.datetime(2016, 3, 27, 0, 0, 0, 0)
localtz = pytz.timezone('Europe/London')
start_dt = localtz.localize(start_dt)
print start_dt
end_dt = start_dt + datetime.timedelta(days=1)
print end_dt
print (end_dt - start_dt).total_seconds()
In the above snippet end_dt evaluates to 2016-03-28 00:00:00+00:00 and the timedelta is 86400. Shouldn't it be 2016-03-28 00:00:00+01:00 and 82800?
I've seen posts saying to use pytz function normalize() to 'normalize' the end_dt, but it just results in a end-dt of 2016-03-28 01:00:00+01:00