On 2022-04-16, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote: > On Sat, 16 Apr 2022 20:35:22 -0000 (UTC), Jon Ribbens ><jon+use...@unequivocal.eu> declaimed the following: >>I can categorically guarantee you it is not. But let's put it a >>different way, if you like, if I want to add 24 hours, i.e. 86,400 >>seconds (or indeed any other fixed time period), to a timezone-aware >>datetime in Python, how do I do it? It would appear that, without >>converting to UTC before doing the calculation, you can't. > > Which is probably the recommended means to do just that.
Yes, as I've already mentioned it is good advice to always use UTC when doing date/time calculations and only convert to another timezone for display. However it is somewhat surprising that Python's datetime simply *does not work* when doing arithmetic on timezone-aware objects. It's not "disrecommended", it's straight-up broken. > The only thing that is most noticeable about UTC is the incorporation > of leap-seconds. I've never yet managed to find an application where leap-seconds matter ;-) -- https://mail.python.org/mailman/listinfo/python-list