inZoneLeniently method

ZonedDateTime inZoneLeniently(
  1. DateTimeZone zone
)

Returns the mapping of this local date/time within the given DateTimeZone, with 'lenient' rules applied such that ambiguous values map to the earlier of the alternatives, and 'skipped' values are shifted forward by the duration of the "gap".

See inZoneStrictly and inZone for alternative ways to map a local time to a specific instant.

This is solely a convenience method for calling ZonedDateTime.atLeniently.

Note: The behavior of this method was changed in version 2.0 to fit the most commonly seen real-world usage pattern. Previous versions returned the later instance of ambiguous values, and returned the start of the zone interval after the gap for skipped value. The previous functionality can still be used if desired, by using InZone(DateTimeZone, ZoneLocalMappingResolver) and passing a resolver that combines the

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

Implementation

ZonedDateTime inZoneLeniently(DateTimeZone zone) {
  Preconditions.checkNotNull(zone, 'zone');
  return ZonedDateTime.atLeniently(this, zone);
}