Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated
by theK on Monday November 20, 2023 @12:13AM
(#38342581)
Correct, neither iso strings mor numbers can get you out of this dilema.
While ISO uses UTC offset and time zone interchangeably it actually is only defined over offsets, not locations.
I've had this problem discussed before. Typically the situation is firing events based on times at specific locations. It is neither straight forward with date libraries nor ist it easy with numeric computation. Sometimes it makes sense to render it down to a specific point in time at storage and not expect the country change timezone overnight. Some times the location itself may be changing randomly (moving objects) but in that case it typically just meant recalculating offsets on movement events.
Note that UTC has a similar problem - which is why you actually need a local time string for this type of events.