ZonedDateTime.ofInstant

Obtains an instance of {@code ZonedDateTime} from the instant formed by combining the local date-time and offset. !(p) This creates a zoned date-time by {@link LocalDateTime#toInstant(ZoneOffset) combining} the {@code LocalDateTime} and {@code ZoneOffset}. This combination uniquely specifies an instant without ambiguity. !(p) Converting an instant to a zoned date-time is simple as there is only one valid offset for each instant. If the valid offset is different to the offset specified, then the date-time and offset of the zoned date-time will differ from those specified. !(p) If the {@code ZoneId} to be used is a {@code ZoneOffset}, this method is equivalent to {@link #of(LocalDateTime, ZoneId)}.

@param localDateTime the local date-time, not null @param offset the zone offset, not null @param zone the time-zone, not null @return the zoned date-time, not null

  1. ZonedDateTime ofInstant(Instant instant, ZoneId zone)
  2. ZonedDateTime ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)

Meta