struct civil_transition

Defined at line 183 of file ../../third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h

Finds the time of the next/previous offset change in this time zone.

By definition, next_transition(tp,

&trans

) returns false when tp has

its maximum value, and prev_transition(tp,

&trans

) returns false

when tp has its minimum value. If the zone has no transitions, the

result will also be false no matter what the argument.

Otherwise, when tp has its minimum value, next_transition(tp,

&trans

)

returns true and sets trans to the first recorded transition. Chains

of calls to next_transition()/prev_transition() will eventually return

false, but it is unspecified exactly when next_transition(tp,

&trans

)

jumps to false, or what time is set by prev_transition(tp,

&trans

) for

a very distant tp.

Note: Enumeration of time-zone transitions is for informational purposes

only. Modern time-related code should not care about when offset changes

occur.

Example:

cctz::time_zone nyc;

if (!cctz::load_time_zone("America/New_York",

&nyc

)) { ... }

const auto now = std::chrono::system_clock::now();

auto tp = cctz::time_point

<cctz

::seconds>::min();

cctz::time_zone::civil_transition trans;

while (tp

<

= now

&

&

nyc.next_transition(tp,

&trans

)) {

// transition: trans.from -> trans.to

tp = nyc.lookup(trans.to).trans;

}

Public Members

civil_time from
civil_time to