TTimeZone.Local versus IANA tzdata wrapper for historic Delphi date conversion?
0 reputation · 19 Apr 2025, 13:34 UTC
Developers need to convert a UTC timestamp from the past (e.g., 1995‑07‑01 12:00) to the local time of a region that has altered its daylight‑saving rules since that date.
The goal is to obtain an offset that matches the historical IANA timezone database, regardless of whether the host operating system has retained those older rules.
Delphi’s RTL TTimeZone.Local converts using the current OS zone information, which is simple but may reflect only the rules present at runtime. An alternative is to wrap an IANA tzdata source, providing deterministic historic offsets at the cost of an external dependency and the need for periodic updates.
Which approach reliably yields correct historic conversions without requiring OS updates, and can the two be used together safely?