Delegate AmbiguousTimeResolver
Namespace: NodaTime.TimeZones
Assembly: NodaTime.dll
Syntax
public delegate ZonedDateTime AmbiguousTimeResolver(ZonedDateTime earlier, ZonedDateTime later)
Parameters
Type | Name | Description |
---|---|---|
ZonedDateTime | earlier | The earlier of the ambiguous matches for the original local date and time |
ZonedDateTime | later | The later of the ambiguous matches for the original local date and time |
Returns
Type | Description |
---|---|
ZonedDateTime | A ZonedDateTime in the target time zone; typically, one of the two input parameters. |
Remarks
This delegate is used by CreateMappingResolver(AmbiguousTimeResolver, SkippedTimeResolver) when handling an ambiguous local time, due to clocks moving backward in a time zone transition (usually due to an autumnal daylight saving transition).
The returned value should be one of the two parameter values, based on the policy of the specific implementation. Alternatively, it can throw an AmbiguousTimeException to implement a policy of "reject ambiguous times."
See the Resolvers class for predefined implementations.
Implementations of this delegate can reasonably assume that the target local date and time really is ambiguous; the behaviour when the local date and time can be unambiguously mapped into the target time zone (or when it's skipped) is undefined.