Table of Contents

Class ZoneOracle

Namespace
Hegel.Temporal
Assembly
Hegel.dll

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

typeAt Func<DateTimeOffset, ZoneLocalType>

The offset in force at an instant. Before firstYear the zone keeps the answer for that year's start.

firstYear int

The first year probed.

lastYear int

The 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

ZoneBeyond

FirstYear

The first year probed.

public int FirstYear { get; }

Property Value

int

LastYear

The last year probed.

public int LastYear { get; }

Property Value

int

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

Func<DateTimeOffset, DateTimeOffset?>

TypeAt

The offset in force at an instant.

public Func<DateTimeOffset, ZoneLocalType> TypeAt { get; }

Property Value

Func<DateTimeOffset, ZoneLocalType>