Predict the output
15:30 UTC on 31 Oct 2026: what local times print?
from datetime import UTC, datetime
from zoneinfo import ZoneInfo
stored = datetime(2026, 10, 31, 15, 30, tzinfo=UTC)
print(stored.astimezone(ZoneInfo("Asia/Kolkata")).strftime("%H:%M"))
print(stored.astimezone(ZoneInfo("America/New_York")).strftime("%H:%M"))Hint 1 of 1
When does US daylight time end in 2026?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A 21:00 then 11:30
Correct. India is UTC+5:30; New York is still on daylight time (UTC−4) on 31 October.
Storing UTC and converting at display time keeps one true instant. Kolkata is a fixed +5:30; New York still uses daylight time (UTC−4) on 31 October 2026 and moves to UTC−5 on 1 November.
Why not the others?
- B
21:00then10:30. New York switches back to UTC−5 on 1 November 2026. - C
10:00then11:30. Kolkata is ahead of UTC. - D
15:30twice. astimezone converts the instant.