[#absl-TimeZone-CivilTransition]
= xref:absl.adoc[absl]::xref:absl/TimeZone.adoc[TimeZone]::CivilTransition
:relfileprefix: ../../
:mrdocs:

A transition in a time zone&colon; the civil times just before and after an offset change&period;

== Synopsis

Declared in `&lt;absl&sol;time&sol;time&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct CivilTransition;
----

== Description

Finds the time of the next&sol;previous offset change in this time zone&period;

By definition, `NextTransition(t, &amp;trans)` returns false when `t` is `InfiniteFuture()`, and `PrevTransition(t, &amp;trans)` returns false when `t` is `InfinitePast()`&period; If the zone has no transitions, the result will also be false no matter what the argument&period;

Otherwise, when `t` is `InfinitePast()`, `NextTransition(t, &amp;trans)` returns true and sets `trans` to the first recorded transition&period; Chains of calls to `NextTransition()&sol;PrevTransition()` will eventually return false, but it is unspecified exactly when `NextTransition(t, &amp;trans)` jumps to false, or what time is set by `PrevTransition(t, &amp;trans)` for a very distant `t`&period;

Note&colon; Enumeration of time&hyphen;zone transitions is for informational purposes only&period; Modern time&hyphen;related code should not care about when offset changes occur&period;

Example&colon; absl&colon;&colon;TimeZone nyc&semi; if (!absl&colon;&colon;LoadTimeZone(&quot;America&sol;New&lowbar;York&quot;, &amp;nyc)) &lcub; &period;&period;&period; &rcub; const auto now &equals; absl&colon;&colon;Now()&semi; auto t &equals; absl&colon;&colon;InfinitePast()&semi; absl&colon;&colon;TimeZone&colon;&colon;CivilTransition trans&semi; while (t &lt;&equals; now &amp;&amp; nyc&period;NextTransition(t, &amp;trans)) &lcub; &sol;&sol; transition&colon; trans&period;from &hyphen;&gt; trans&period;to t &equals; nyc&period;At(trans&period;to)&period;trans&semi; &rcub;

== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:absl/TimeZone/CivilTransition/from.adoc[`from`] 
| the civil time we jump from
| xref:absl/TimeZone/CivilTransition/to.adoc[`to`] 
| the civil time we jump to
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
