Which UTC offset does Qt pick for ambiguous local times during DST fall‑back across platforms?
0 reputation · 17 Sept 2022, 16:23 UTC
Ambiguous DST times in Qt
When a local wall‑clock time occurs twice during the fall‑back transition, Qt must decide which UTC offset to apply. The default is to use the earlier offset, but this choice is not formally guaranteed across operating systems or future Qt releases. Unix‑like hosts query the IANA time‑zone database while Windows historically consults the system registry, so the same zone identifier can resolve differently.
Because Qt does not bundle its own time‑zone data, an application’s conversions can change after an OS update without any code modification. Developers need to know whether the chosen offset is stable enough for round‑trip conversions and for cross‑platform deployments.
Which UTC offset does Qt select for a given ambiguous local time on Windows versus Unix? Does Qt guarantee that a round‑trip conversion preserves the original instant for ambiguous times across all supported Qt releases? Can developers explicitly query the chosen offset before performing conversions, or must they rely on the default resolution?