Class ZoneOracle
A time zone described by a function from an instant to the offset in force, for a library that answers lookups but does not expose its zone data. The engine probes the function over a range of years to find the zone's transitions, when the zone is added to a ZoneSource.
public sealed class ZoneOracle
- Inheritance
-
ZoneOracle
- Inherited Members
Constructors
ZoneOracle(Func<DateTimeOffset, ZoneLocalType>, int, int)
An oracle probed from the start of firstYear to the end of lastYear.
public ZoneOracle(Func<DateTimeOffset, ZoneLocalType> typeAt, int firstYear, int lastYear)
Parameters
typeAtFunc<DateTimeOffset, ZoneLocalType>The offset in force at an instant. Before
firstYearthe zone keeps the answer for that year's start.firstYearintThe first year probed.
lastYearintThe last year probed.
Properties
Beyond
What the zone does after LastYear: by default it keeps its last offset.
public ZoneBeyond Beyond { get; init; }
Property Value
FirstYear
The first year probed.
public int FirstYear { get; }
Property Value
LastYear
The last year probed.
public int LastYear { get; }
Property Value
NextTransition
The first instant after the one given at which the answer of TypeAt changes, or null when it never changes again. Without it the engine samples TypeAt once a day and bisects each change to the second, which misses two changes less than a day apart.
public Func<DateTimeOffset, DateTimeOffset?>? NextTransition { get; init; }
Property Value
TypeAt
The offset in force at an instant.
public Func<DateTimeOffset, ZoneLocalType> TypeAt { get; }