Silent misinterpretation of ambiguous DST fallback time in TimeZones.jl
0 reputation · 20 Oct 2022, 09:18 UTC
Goal: reliably detect or handle ambiguous local times that occur twice during DST fallback when using TimeZones.jl's ZonedDateTime constructor, to prevent silent misinterpretation of timestamps.
Constraints: the solution must preserve backward compatibility for existing code that relies on the current default (earlier occurrence), avoid adding runtime overhead in hot paths, and work across Julia versions without requiring package major bumps. Uncertainty remains about whether the constructor should warn, require an explicit disambiguation argument, or provide a separate detection API.
- Should the ZonedDateTime constructor emit a warning (or error) when the supplied wall time is ambiguous in the target zone?
- Would it be acceptable to require an optional keyword argument (e.g., disambiguate=:early|:late|:error) to resolve ambiguity explicitly?
- Could a standalone function like `ambiguous_times(zonetime, zone)` be added to let users check for ambiguity before construction?