struct civil_lookup
Defined at line 143 of file ../../third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h
A civil_lookup represents the absolute time(s) (time_point) that
correspond to the given civil time (cctz::civil_second) within this
time_zone. Usually the given civil time represents a unique instant
in time, in which case the conversion is unambiguous. However,
within this time zone, the given civil time may be skipped (e.g.,
during a positive UTC offset shift), or repeated (e.g., during a
negative UTC offset shift). To account for these possibilities,
civil_lookup is richer than just a single time_point.
In all cases the civil_lookup::kind enum will indicate the nature
of the given civil-time argument, and the pre, trans, and post
members will give the absolute time answers using the pre-transition
offset, the transition point itself, and the post-transition offset,
respectively (all three times are equal if kind == UNIQUE). If any
of these three absolute times is outside the representable range of a
time_point
<seconds
> the field is set to its maximum/minimum value.
Example:
cctz::time_zone lax;
if (!cctz::load_time_zone("America/Los_Angeles",
&lax
)) { ... }
// A unique civil time.
auto jan01 = lax.lookup(cctz::civil_second(2011, 1, 1, 0, 0, 0));
// jan01.kind == cctz::time_zone::civil_lookup::UNIQUE
// jan01.pre is 2011/01/01 00:00:00 -0800
// jan01.trans is 2011/01/01 00:00:00 -0800
// jan01.post is 2011/01/01 00:00:00 -0800
// A Spring DST transition, when there is a gap in civil time.
auto mar13 = lax.lookup(cctz::civil_second(2011, 3, 13, 2, 15, 0));
// mar13.kind == cctz::time_zone::civil_lookup::SKIPPED
// mar13.pre is 2011/03/13 03:15:00 -0700
// mar13.trans is 2011/03/13 03:00:00 -0700
// mar13.post is 2011/03/13 01:15:00 -0800
// A Fall DST transition, when civil times are repeated.
auto nov06 = lax.lookup(cctz::civil_second(2011, 11, 6, 1, 15, 0));
// nov06.kind == cctz::time_zone::civil_lookup::REPEATED
// nov06.pre is 2011/11/06 01:15:00 -0700
// nov06.trans is 2011/11/06 01:00:00 -0800
// nov06.post is 2011/11/06 01:15:00 -0800
Public Members
civil_kind kind
time_point pre
time_point trans
time_point post
Enumerations
enum civil_kind
| Name | Value |
|---|---|
| UNIQUE | 0 |
| SKIPPED | 1 |
| REPEATED | 2 |
Defined at line 144 of file ../../third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h