ZonedDateTime.atStrictly constructor

ZonedDateTime.atStrictly(
  1. LocalDateTime localDateTime,
  2. DateTimeZone zone
)

Maps the given LocalDateTime to the corresponding ZonedDateTime, if and only if that mapping is unambiguous in this time zone. Otherwise, SkippedTimeError or AmbiguousTimeException is thrown, depending on whether the mapping is ambiguous or the local date/time is skipped entirely.

See atLeniently and ResolveLocal(LocalDateTime, ZoneLocalMappingResolver) for alternative ways to map a local time to a specific instant.

  • localDateTime: The local date and time to map into this time zone.

  • SkippedTimeError: The given local date/time is skipped in this time zone.

  • AmbiguousTimeError: The given local date/time is ambiguous in this time zone. Returns: The unambiguous matching ZonedDateTime if it exists.

Implementation

factory ZonedDateTime.atStrictly(LocalDateTime localDateTime, DateTimeZone zone) =>
    ZonedDateTime.resolve(localDateTime, zone, Resolvers.strictResolver);