Exercise 2 solution from datetime import datetime, date, time, timezone from zoneinfo import ZoneInfo UTC = timezone.utc LON = ZoneInfo("Europe/London") def resolve(d, t, zone): z = ZoneInfo(zone) return datetime.combine(d, t, tzinfo=z).astimezone(UTC).astimezone(z) print("spring gap") for day in range(27, 31): r = resolve(date(2027, 3, day), time(1, 30), "Europe/London") print(date(2027, 3, day), "->", r.strftime("%H:%M %Z"), r.astimezone(UTC).strftime("%H:%M UTC")) print("autumn fold") d = datetime(2026, 10, 25, 1, 30, tzinfo=LON) for fold in (0, 1): x = d.replace(fold=fold) print("fold", fold, x.strftime("%H:%M %Z"), x.astimezone(UTC).strftime("%H:%M UTC")) print("same wall time, same offset?", d == d.replace(fold=1)) print("hours apart:", (d.replace(fold=1).astimezone(UTC) - d.astimezone(UTC))) Output (run, and exactly as shown): spring gap 2027-03-27 -> 01:30 GMT 01:30 UTC 2027-03-28 -> 02:30 BST 01:30 UTC 2027-03-29 -> 01:30 BST 00:30 UTC 2027-03-30 -> 01:30 BST 00:30 UTC autumn fold fold 0 01:30 BST 00:30 UTC fold 1 01:30 GMT 01:30 UTC same wall time, same offset? True hours apart: 1:00:00 Explanation: on 28 March 2027 the clocks in London jump from 01:00 to 02:00, so 01:30 does not exist that day. Converting through UTC and back moves it forward by the length of the gap, to 02:30 BST. That policy keeps the event on the same date and never drops it, but it lands at the same UTC instant as the previous day's 01:30 GMT, 24 hours apart. On 25 October 2026 the clocks go back from 02:00 to 01:00, so 01:30 happens twice: fold=0 is the first time (BST, 00:30 UTC) and fold=1 the second (GMT, 01:30 UTC), one hour apart. resolve() always picks the first, which is a policy you should state in the toolkit's documentation. Note that the two aware values compare equal (True): comparing two datetimes that share the same tzinfo object ignores the offset and fold, so convert both to UTC before comparing or subtracting, as the last line does.