PyCharm debugger naive datetime interpretation defaults to IDE time zone without visual distinction
0 reputation · 14 Aug 2025, 20:54 UTC
0 reputation · 14 Aug 2025, 20:54 UTC
PyCharm's debugger displays timezone-aware datetime objects with their UTC offset, but naive datetime objects are rendered in the configured IDE time zone without any visual indicator that they lack timezone information. An open YouTrack issue debates whether naive datetimes should be assumed UTC or local time, leaving the default interpretation unresolved.
The IDE time zone setting (Settings > Appearance & Behavior > System Settings > Time Zone) governs this presentation, yet no project-level override or explicit annotation exists to differentiate naive from aware objects in the Variables or Watches panes. Code inspections for zoneinfo added in 2023.3 flag ambiguous conversions but do not enforce a project-wide time zone policy.
This behavior affects debugging sessions where naive datetimes originate from third-party libraries or legacy code, making it difficult to verify whether displayed values reflect UTC, the system zone, or the IDE override.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.