single method

ZonedDateTime single()

Returns the single ZonedDateTime which maps to the original LocalDateTime in the mapped DateTimeZone.

SkippedTimeError: The local date/time was skipped in the time zone. AmbiguousTimeError: The local date/time was ambiguous in the time zone. Returns: The unambiguous result of mapping the local date/time in the time zone.

Implementation

ZonedDateTime single() {
  switch (count) {
    case 0:
      throw SkippedTimeError(localDateTime, zone);
    case 1:
      return _buildZonedDateTime(earlyInterval);
    case 2:
      throw AmbiguousTimeError(
          _buildZonedDateTime(earlyInterval),
          _buildZonedDateTime(lateInterval));
    default:
      throw StateError("Can't happen");
  }
}