inZoneStrictly method

ZonedDateTime inZoneStrictly(
  1. DateTimeZone zone
)

Returns the mapping of this local date/time within the given DateTimeZone, with 'strict' rules applied such that an exception is thrown if either the mapping is ambiguous or the time is skipped.

See inZoneLeniently and inZone for alternative ways to map a local time to a specific instant. This is solely a convenience method for calling ZonedDateTime.atStrictly.

  • zone: The time zone in which to map this local date/time.

Returns: The result of mapping this local date/time in the given time zone.

  • SkippedTimeException: This local date/time is skipped in the given time zone.
  • AmbiguousTimeException: This local date/time is ambiguous in the given time zone.

Implementation

ZonedDateTime inZoneStrictly(DateTimeZone zone) {
  Preconditions.checkNotNull(zone, 'zone');
  return ZonedDateTime.atStrictly(this, zone);
}