Delegate SkippedTimeResolver
Resolves a LocalDateTime to a ZonedDateTime in the situation
where the requested local time does not exist, due to clocks moving forward in a time zone transition
(usually due to a spring daylight saving transition).
Since 1.0.x
Availability net35-Client, PCL
Namespace: NodaTime.TimeZones
Assembly: NodaTime.dll
Syntax
public delegate ZonedDateTime SkippedTimeResolver(LocalDateTime localDateTime, DateTimeZone zone, ZoneInterval intervalBefore, ZoneInterval intervalAfter);
Parameters
Type | Name | Description |
---|---|---|
LocalDateTime | localDateTime | The local date and time to map to the given time zone |
DateTimeZone | zone | The target time zone |
ZoneInterval | intervalBefore | The zone interval directly before the target local date and time would have occurred |
ZoneInterval | intervalAfter | The zone interval directly after the target local date and time would have occurred |
Returns
Type | Description |
---|---|
ZonedDateTime | A ZonedDateTime in the target time zone, |
Remarks
The returned value will necessarily represent a different local date and time to the target one, but the exact form of mapping is up to the delegate implementation. For example, it could return a value as close to the target local date and time as possible, or the time immediately after the transition. Alternatively, it can throw a SkippedTimeException to implement a policy of "reject skipped times."
See the Resolvers class for predefined implementations.
Implementations of this delegate can reasonably assume that the target local date and time really is skipped; the behaviour when the local date and time can be directly mapped into the target time zone is undefined.