AmbiguousTimeResolver typedef

AmbiguousTimeResolver = ZonedDateTime Function(ZonedDateTime earlier, ZonedDateTime later)

Chooses between two ZonedDateTime values that resolve to the same LocalDateTime.

This delegate is used by Resolvers.createMappingResolver 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.

earlier: The earlier of the ambiguous matches for the original local date and time later: The later of the ambiguous matches for the original local date and time AmbiguousTimeException: The implementation rejects requests to map ambiguous times.

A ZonedDateTime in the target time zone; typically, one of the two input parameters.

Implementation

typedef AmbiguousTimeResolver = ZonedDateTime Function(ZonedDateTime earlier, ZonedDateTime later);