GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
libstdc++

libstdc++: Apply rule triggering at Zone line transition

Fixes timezone data parsing to correctly handle rules triggering exactly at transition boundaries.

This commit addresses an issue in libstdc++‘s timezone handling where rules triggering precisely at a zone line transition were not always correctly applied. This resulted in inconsistencies compared to the standard date library for certain zones, such as Europe/Lisbon in 1976. The fix ensures that find_active_rule considers rules firing exactly at the transition time, improving the accuracy and consistency of timezone information.

In Details

Corrects time_zone::_M_get_sys_info to invoke find_active_rule with info.begin() when seeding zone information from rules around a transition boundary. Previously, the rule_start - t < days(1) check too strictly excluded rules that triggered exactly at the transition. This change resolves inconsistencies with the date library for historical timezone data, particularly for transitions occurring at midnight.

For Context
time zone
A region of the globe that observes a uniform standard time for legal, commercial, and social purposes. Time zones are defined by offsets from UTC.
transition
A point in time when a change occurs in a time zone's rules, such as the start or end of Daylight Saving Time, or a change in the standard offset from UTC.
UTC
Coordinated Universal Time. The primary time standard by which the world regulates clocks and time. It is equivalent to GMT and is the basis for other time zones.
libstdc++
The C++ standard library implementation used by GCC. It provides core C++ language features and utilities, including date and time handling.
Filed Under: libstdc++timezonebugfixconsistency