Relying on Windows for Time Zone logic is risky:
Raw files downloaded from IANA.
africa northamericaDelphi utility parses raw text and generates resource.
TZCompile.dprCompressed binary data embedded in your exe.
TZDB.resReads internal resource, ignoring OS settings.
TBundledTimeZoneImportant: This is a standalone class, not a descendant of TTimeZone. It mimics the API for familiarity.
Uses standard IANA strings ("Europe/Paris") which are consistent across all platforms and databases (Postgres, Mongo).
When you update the library (recompile), you update the rules. You control the version, not Microsoft.
API Compatibility: Provides methods like ToLocalTime, ToUniversalTime, and GetUtcOffset that mirror standard Delphi logic, but operates on its own internal data structures.
Thread Safety: The resource reading is thread-safe, making it suitable for high-load server applications (e.g., DataSnap, RAD Server).
uses System.DateUtils, TZDB; // The magic unit var NY_Zone: TBundledTimeZone; // Specific type, not TTimeZone MyTime: TDateTime; begin // 1. Get specific zones by IANA ID NY_Zone := TBundledTimeZone.GetTimeZone('America/New_York'); // 2. Convert Time MyTime := Now; WriteLn('NY Time: ' + NY_Zone.ToLocalTime(MyTime).ToString); // 3. List all available zones for var ID in TBundledTimeZone.KnownTimeZones do WriteLn(ID); // 4. Clean up manually (since it's not owned by system) // (Though often cache handles lifecycle) end;