Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class NodaTime.​TimeZones.​Resolvers

Assembly: NodaTime

Inheritance: object → Resolvers

Commonly-used implementations of the delegates used in resolving a <see cref="T:NodaTime.LocalDateTime" /> to a <see cref="T:NodaTime.ZonedDateTime" /> , and a method to combine two "partial" resolvers into a full one.

Remarks

<para> This class contains predefined implementations of <see cref="T:NodaTime.TimeZones.ZoneLocalMappingResolver" />, <see cref="T:NodaTime.TimeZones.AmbiguousTimeResolver" />, and <see cref="T:NodaTime.TimeZones.SkippedTimeResolver" />, along with <see cref="M:NodaTime.TimeZones.Resolvers.CreateMappingResolver(NodaTime.TimeZones.AmbiguousTimeResolver,NodaTime.TimeZones.SkippedTimeResolver)" />, which produces a <c>ZoneLocalMappingResolver</c> from instances of the other two. </para>

Properties

public static AmbiguousTimeResolver
ReturnEarlier
An <see cref="T:NodaTime.TimeZones.AmbiguousTimeResolver" /> which returns the earlier of the two matching times.
public static AmbiguousTimeResolver
ReturnLater
An <see cref="T:NodaTime.TimeZones.AmbiguousTimeResolver" /> which returns the later of the two matching times.
public static AmbiguousTimeResolver
ThrowWhenAmbiguous
An <see cref="T:NodaTime.TimeZones.AmbiguousTimeResolver" /> which simply throws an <see cref="T:NodaTime.AmbiguousTimeException" /> .
public static SkippedTimeResolver
ReturnEndOfIntervalBefore
A <see cref="T:NodaTime.TimeZones.SkippedTimeResolver" /> which returns the final tick of the time zone interval before the "gap".
public static SkippedTimeResolver
ReturnStartOfIntervalAfter
A <see cref="T:NodaTime.TimeZones.SkippedTimeResolver" /> which returns the first tick of the time zone interval after the "gap".
public static SkippedTimeResolver
ReturnForwardShifted
A <see cref="T:NodaTime.TimeZones.SkippedTimeResolver" /> which shifts values in the "gap" forward by the duration of the gap (which is usually 1 hour). This corresponds to the instant that would have occured, had there not been a transition.
public static SkippedTimeResolver
ThrowWhenSkipped
A <see cref="T:NodaTime.TimeZones.SkippedTimeResolver" /> which simply throws a <see cref="T:NodaTime.SkippedTimeException" /> .
public static ZoneLocalMappingResolver
StrictResolver
A <see cref="T:NodaTime.TimeZones.ZoneLocalMappingResolver" /> which only ever succeeds in the (usual) case where the result of the mapping is unambiguous.
Remarks If the mapping is ambiguous or skipped, this throws <see cref="T:NodaTime.SkippedTimeException" /> or <see cref="T:NodaTime.AmbiguousTimeException" /> , as appropriate. This resolver combines <see cref="P:NodaTime.TimeZones.Resolvers.ThrowWhenAmbiguous" /> and <see cref="P:NodaTime.TimeZones.Resolvers.ThrowWhenSkipped" /> .
public static ZoneLocalMappingResolver
LenientResolver
A <see cref="T:NodaTime.TimeZones.ZoneLocalMappingResolver" /> which never throws an exception due to ambiguity or skipped time.
Remarks Ambiguity is handled by returning the earlier occurrence, and skipped times are shifted forward by the duration of the gap. This resolver combines <see cref="P:NodaTime.TimeZones.Resolvers.ReturnEarlier" /> and <see cref="P:NodaTime.TimeZones.Resolvers.ReturnForwardShifted" /> . <para>Note: The behavior of this resolver was changed in version 2.0 to fit the most commonly seen real-world usage pattern. Previous versions combined the <see cref="P:NodaTime.TimeZones.Resolvers.ReturnLater" /> and <see cref="P:NodaTime.TimeZones.Resolvers.ReturnStartOfIntervalAfter" /> resolvers, which can still be used separately if desired.</para>

Methods

public static ZoneLocalMappingResolver
CreateMappingResolver​(AmbiguousTimeResolver ambiguousTimeResolver, SkippedTimeResolver skippedTimeResolver)
Combines an <see cref="T:NodaTime.TimeZones.AmbiguousTimeResolver" /> and a <see cref="T:NodaTime.TimeZones.SkippedTimeResolver" /> to create a <see cref="T:NodaTime.TimeZones.ZoneLocalMappingResolver" /> .
Returns The logical combination of the two resolvers.
ambiguousTimeResolver Resolver to use for ambiguous mappings.
skippedTimeResolver Resolver to use for "skipped" mappings.
Remarks The <c>ZoneLocalMappingResolver</c> created by this method operates in the obvious way: unambiguous mappings are returned directly, ambiguous mappings are delegated to the given <c>AmbiguousTimeResolver</c> , and "skipped" mappings are delegated to the given <c>SkippedTimeResolver</c> .
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object