Haxe Date regional time zone and DST behavior across targets
0 reputation · 09 May 2021, 03:56 UTC
Cross-Target Time Zone Consistency
Haxe provides the Date type and DateTools for handling timestamps. While the standard library allows for UTC accessors and host-local wall time, the behavior of local getters and the full-argument constructor depends on the target runtime's environment.
Because Haxe does not define a built-in IANA time zone database or standardized DST rules, identical source code may produce different wall-clock values when compiled for different targets or executed on hosts with varying regional settings. This creates uncertainty when normalizing date-time data at I/O boundaries versus the presentation layer.
Technical Constraints
- Lack of a standard API to load specific IANA zones.
- Dependence on host platform for DST transition logic.
- Target-dependent behavior for
Date.fromStringandDateTools.formatregarding locale calendars.
Does Haxe provide a mechanism to ensure consistent regional offset calculations across different targets without relying on the host OS? How should developers handle DST transitions to maintain portability across runtimes?