last method

ZonedDateTime last()

Returns a ZonedDateTime which maps to the original LocalDateTime in the mapped DateTimeZone: either the single result if the mapping is unambiguous, or the later result if the local date/time occurs twice in the time zone due to a time zone offset change such as an autumnal daylight saving transition.

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

Implementation

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