From 708483db7bfdbe742916ebab7c115313ed1c6711 Mon Sep 17 00:00:00 2001 From: Bradley White Date: Wed, 10 Jan 2018 22:50:00 -0500 Subject: [PATCH] Given the recent reinterpretation of "IST" in post-1968 Europe/Dublin as "Irish Standard Time" but still prevailing during the summer months, with the "daylight saving time" applying during the winter months using a negative delta, it is no longer accurate to think of the STD->DST transition as occurring in Spring and the DST->STD transition as occurring in Autumn. So, let's avoid using those labels. --- src/time_zone_info.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/time_zone_info.cc b/src/time_zone_info.cc index 3696a5b3..be847782 100644 --- a/src/time_zone_info.cc +++ b/src/time_zone_info.cc @@ -337,15 +337,18 @@ void TimeZoneInfo::ExtendTransitions(const std::string& name, extended_ = true; // The future specification should match the last two transitions, - // and those transitions should have different is_dst flags. + // and those transitions should have different is_dst flags. Note + // that nothing says the UTC offset used by the is_dst transition + // must be greater than that used by the !is_dst transition. (See + // Europe/Dublin, for example.) const Transition* tr0 = &transitions_[hdr.timecnt - 1]; const Transition* tr1 = &transitions_[hdr.timecnt - 2]; const TransitionType* tt0 = &transition_types_[tr0->type_index]; const TransitionType* tt1 = &transition_types_[tr1->type_index]; - const TransitionType& spring(tt0->is_dst ? *tt0 : *tt1); - const TransitionType& autumn(tt0->is_dst ? *tt1 : *tt0); - CheckTransition(name, spring, posix.dst_offset, true, posix.dst_abbr); - CheckTransition(name, autumn, posix.std_offset, false, posix.std_abbr); + const TransitionType& dst(tt0->is_dst ? *tt0 : *tt1); + const TransitionType& std(tt0->is_dst ? *tt1 : *tt0); + CheckTransition(name, dst, posix.dst_offset, true, posix.dst_abbr); + CheckTransition(name, std, posix.std_offset, false, posix.std_abbr); // Add the transitions to tr1 and back to tr0 for each extra year. last_year_ = LocalTime(tr0->unix_time, *tt0).cs.year();