[Bug libstdc++/116110] Transitions obtained from chrono::time_zone::get_info should not treat times as UTC
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Mar 14 00:05:12 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116110
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #0)
> // XXX The ri.until() time point should be
> // "interpreted using the rules in effect just before the transition"
> info.end = ri.until();
We should not assume that ri.until() is correct here, it might need
adjusting...
> // XXX UNTIL field should be interpreted
> // "using the rules in effect just before the transition"
> // so might need to store as year_month_day and hh_mm_ss and only
> // convert to a sys_time once we know the offset in effect.
> inf.m_until = sys_days(year(y)/m.m/day(d)) + seconds(t.time);
For some cases we know here that the time is UTC, or is a fixed offset from UTC
(because we're parsing a zone line that uses a fixed amount of time in the
RULES column, or uses "-" in the RULES column). We can set inf.m_until
correctly in those cases.
But when RULES is the name of a Rule line, we need to record here that we need
to make a later adjustment to info.m_until based on the rule in effect at that
time. So we can just set a flag here saying "neds adjustment", and then use
that in time_zone::_M_get_sys_info to set info.end = ri.until() +
some_adjustment
More information about the Gcc-bugs
mailing list