ZonedDateTime.resolve constructor

ZonedDateTime.resolve(
  1. LocalDateTime localDateTime,
  2. DateTimeZone zone,
  3. ZoneLocalMappingResolver resolver
)

Maps the given LocalDateTime to the corresponding ZonedDateTime, following the given ZoneLocalMappingResolver to handle ambiguity and skipped times.

This is a convenience method for calling mapLocal and passing the result to the resolver. Common options for resolvers are provided in the static Resolvers class.

See atStrictly and atLeniently for alternative ways to map a local time to a specific instant.

  • localDateTime: The local date and time to map in this time zone.
  • resolver: The resolver to apply to the mapping.

Returns: The result of resolving the mapping.

Implementation

factory ZonedDateTime.resolve(LocalDateTime localDateTime, DateTimeZone zone, ZoneLocalMappingResolver resolver) {
  Preconditions.checkNotNull(resolver, 'resolver');
  return resolver(zone.mapLocal(localDateTime));
}