[Feature Request] Add validation in zic for invalid DST intervals
Hello tzdata maintainers, I would like to propose a feature enhancement for the zic compiler. Currently, the NOS time zone rules are defined as: Rule NOS 1970 2037 - Jan 27 23:43:01 2:0 SDST Rule NOS 1970 2037 - Jan 28 0:51:01 0 S Zone OS/NOS +7:0:0 NOS NO%s Issue: - The first rule enters DST at 23:43:01 with a +2 hour offset, moving local time to 01:43:01. - The second rule is intended to revert to standard time at 00:51:01. - Due to the offset, 00:51:01 local time never occurs, so the second rule will never trigger. - This creates unreachable local times and may cause incorrect results in time calculations. Proposal: - Add validation in the zic command to detect DST rules where the offset causes the subsequent rule's local time to be unreachable. - The validation could issue a warning or error to alert the author of potentially invalid rules. - This would improve the robustness of time zone definitions and prevent subtle bugs in downstream applications. Thank you for your consideration. Best regards
On 2025-10-10 05:34, 任春辉 via tz wrote:
Proposal:
- Add validation in the zic command to detect DST rules where the offset causes the subsequent rule's local time to be unreachable.
Something like that could be useful, yes. It might be a bit tricky, though. If someone proposed code changes along those lines I'd be happy to review the changes.
participants (2)
-
Paul Eggert -
任春辉