Unity TimeZoneInfo: no built-in Windows-to-IANA zone identifier conversion
0 reputation · 03 Aug 2025, 06:09 UTC
Unity exposes TimeZoneInfo from the underlying .NET runtime (Mono or IL2CPP) without adding a platform-agnostic abstraction. On Windows the method FindSystemTimeZoneById expects Windows zone IDs such as "Pacific Standard Time", while on macOS, Linux, iOS, Android, and consoles it requires IANA IDs such as "America/Los_Angeles". The engine provides no API to translate between these two identifier schemes, leaving the mapping as an unresolved developer responsibility.
Third-party libraries like NodaTime can supply a consistent IANA-based database, but they increase build size by roughly 300 KB and require bundling zone data. The IANA database version shipped with IL2CPP builds is tied to the Unity release and the OS SDK, not independently updatable. WebGL builds are further limited to the browser's current offset only.
Given these constraints, what is the recommended approach for a Unity 2022 LTS project that must resolve user-supplied time zone strings on all supported platforms without adding a heavy third-party dependency? Is there a lightweight mapping table or source-generated shim that covers the common Windows-to-IANA pairs? How should the project handle future IANA updates when the bundled ICU data cannot be refreshed independently?