ZonedDateTime.ofInstant

Obtains an instance of {@code ZonedDateTime} from an {@code Instant}. !(p) This creates a zoned date-time with the same instant as that specified. Calling {@link #toInstant()} will return an instant equal to the one used here. !(p) Converting an instant to a zoned date-time is simple as there is only one valid offset for each instant.

@param instant the instant to create the date-time from, not null @param zone the time-zone, not null @return the zoned date-time, not null @throws DateTimeException if the result exceeds the supported range

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

Meta