Open ben-n93 opened 3 weeks ago
I am trying to understand why the time of the sydney_aedt object is not being adjusted to reflect the change in timezone offset:
sydney_aedt
import datetime import zoneinfo sydney_aest = datetime.datetime(2024, 8, 30, 15, 0, 0) sydney_aest = sydney_aest.astimezone(zoneinfo.ZoneInfo("Australia/Sydney")) print(sydney_aest) sydney_aedt = sydney_aest + datetime.timedelta(days=90) print(sydney_aedt)
Expected output:
2024-08-30 15:00:00+10:00 2024-11-28 16:00:00+11:00 # Clock moves forward an hour.
Actual output:
2024-08-30 15:00:00+10:00 2024-11-28 15:00:00+11:00 # Time is the same.
I would expected that with the change from AEST to AEDT the hour should move forward an hour however as you can see this is not the result.
3.12
macOS
I'm sorry that I don't have a mac, but I will test it on win.
Bug report
Bug description:
I am trying to understand why the time of the
sydney_aedt
object is not being adjusted to reflect the change in timezone offset:Expected output:
Actual output:
I would expected that with the change from AEST to AEDT the hour should move forward an hour however as you can see this is not the result.
CPython versions tested on:
3.12
Operating systems tested on:
macOS