Trying to optimize some python code, and learning on the job, i was wondering why:
dt = state.last_changed
dt = dt + datetime.timedelta(hours= 2)
wouldn’t be replace by:
dt = state.last_changed + datetime.timedelta(hours= 2)
any reason the latter would be less robust or desirable ?
also, i was wondering if the obvious daylights savings issue here, (had hours=1 till today…) could be tackled in another way.
Thanks for any insights,
Marius