Uses of Class
java.time.ZoneId
-
Packages that use ZoneId Package Description java.time The main API for dates, times, instants, and durations.java.time.chrono Generic API for calendar systems other than the default ISO.java.time.format Provides classes to print and parse dates and times.java.time.temporal Access to date and time using fields and units, and date time adjusters.java.util Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes. -
-
Uses of ZoneId in java.time
Subclasses of ZoneId in java.time Modifier and Type Class Description classZoneOffsetA time-zone offset from Greenwich/UTC, such as+02:00.Methods in java.time that return ZoneId Modifier and Type Method Description static ZoneIdZoneId. from(TemporalAccessor temporal)Obtains an instance ofZoneIdfrom a temporal object.abstract ZoneIdClock. getZone()Gets the time-zone being used to create dates and times.ZoneIdZonedDateTime. getZone()Gets the time-zone, such as 'Europe/Paris'.ZoneIdZoneId. normalized()Normalizes the time-zone ID, returning aZoneOffsetwhere possible.static ZoneIdZoneId. of(String zoneId)Obtains an instance ofZoneIdfrom an ID ensuring that the ID is valid and available for use.static ZoneIdZoneId. of(String zoneId, Map<String,String> aliasMap)Obtains an instance ofZoneIdusing its ID using a map of aliases to supplement the standard zone IDs.static ZoneIdZoneId. ofOffset(String prefix, ZoneOffset offset)Obtains an instance ofZoneIdwrapping an offset.static ZoneIdZoneId. systemDefault()Gets the system default time-zone.Methods in java.time with parameters of type ZoneId Modifier and Type Method Description ZonedDateTimeLocalDate. atStartOfDay(ZoneId zone)Returns a zoned date-time from this date at the earliest valid time according to the rules in the time-zone.ZonedDateTimeInstant. atZone(ZoneId zone)Combines this instant with a time-zone to create aZonedDateTime.ZonedDateTimeLocalDateTime. atZone(ZoneId zone)Combines this date-time with a time-zone to create aZonedDateTime.ZonedDateTimeOffsetDateTime. atZoneSameInstant(ZoneId zone)Combines this date-time with a time-zone to create aZonedDateTimeensuring that the result has the same instant.ZonedDateTimeOffsetDateTime. atZoneSimilarLocal(ZoneId zone)Combines this date-time with a time-zone to create aZonedDateTimetrying to keep the same local date and time.static ClockClock. fixed(Instant fixedInstant, ZoneId zone)Obtains a clock that always returns the same instant.static LocalDateLocalDate. now(ZoneId zone)Obtains the current date from the system clock in the specified time-zone.static LocalDateTimeLocalDateTime. now(ZoneId zone)Obtains the current date-time from the system clock in the specified time-zone.static LocalTimeLocalTime. now(ZoneId zone)Obtains the current time from the system clock in the specified time-zone.static MonthDayMonthDay. now(ZoneId zone)Obtains the current month-day from the system clock in the specified time-zone.static OffsetDateTimeOffsetDateTime. now(ZoneId zone)Obtains the current date-time from the system clock in the specified time-zone.static OffsetTimeOffsetTime. now(ZoneId zone)Obtains the current time from the system clock in the specified time-zone.static YearYear. now(ZoneId zone)Obtains the current year from the system clock in the specified time-zone.static YearMonthYearMonth. now(ZoneId zone)Obtains the current year-month from the system clock in the specified time-zone.static ZonedDateTimeZonedDateTime. now(ZoneId zone)Obtains the current date-time from the system clock in the specified time-zone.static ZonedDateTimeZonedDateTime. of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneId zone)Obtains an instance ofZonedDateTimefrom a year, month, day, hour, minute, second, nanosecond and time-zone.static ZonedDateTimeZonedDateTime. of(LocalDate date, LocalTime time, ZoneId zone)Obtains an instance ofZonedDateTimefrom a local date and time.static ZonedDateTimeZonedDateTime. of(LocalDateTime localDateTime, ZoneId zone)Obtains an instance ofZonedDateTimefrom a local date-time.static LocalDateLocalDate. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofLocalDatefrom anInstantand zone ID.static LocalDateTimeLocalDateTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofLocalDateTimefrom anInstantand zone ID.static LocalTimeLocalTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofLocalTimefrom anInstantand zone ID.static OffsetDateTimeOffsetDateTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofOffsetDateTimefrom anInstantand zone ID.static OffsetTimeOffsetTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofOffsetTimefrom anInstantand zone ID.static ZonedDateTimeZonedDateTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofZonedDateTimefrom anInstant.static ZonedDateTimeZonedDateTime. ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)Obtains an instance ofZonedDateTimefrom the instant formed by combining the local date-time and offset.static ZonedDateTimeZonedDateTime. ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset)Obtains an instance ofZonedDateTimefrom a local date-time using the preferred offset if possible.static ZonedDateTimeZonedDateTime. ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)Obtains an instance ofZonedDateTimestrictly validating the combination of local date-time, offset and zone ID.static ClockClock. system(ZoneId zone)Obtains a clock that returns the current instant using the best available system clock.static ClockClock. tickMillis(ZoneId zone)Obtains a clock that returns the current instant ticking in whole milliseconds using the best available system clock.static ClockClock. tickMinutes(ZoneId zone)Obtains a clock that returns the current instant ticking in whole minutes using the best available system clock.static ClockClock. tickSeconds(ZoneId zone)Obtains a clock that returns the current instant ticking in whole seconds using the best available system clock.abstract ClockClock. withZone(ZoneId zone)Returns a copy of this clock with a different time-zone.ZonedDateTimeZonedDateTime. withZoneSameInstant(ZoneId zone)Returns a copy of this date-time with a different time-zone, retaining the instant.ZonedDateTimeZonedDateTime. withZoneSameLocal(ZoneId zone)Returns a copy of this date-time with a different time-zone, retaining the local date-time if possible. -
Uses of ZoneId in java.time.chrono
Methods in java.time.chrono that return ZoneId Modifier and Type Method Description ZoneIdChronoZonedDateTime. getZone()Gets the zone ID, such as 'Europe/Paris'.Methods in java.time.chrono with parameters of type ZoneId Modifier and Type Method Description ChronoZonedDateTime<D>ChronoLocalDateTime. atZone(ZoneId zone)Combines this time with a time-zone to create aChronoZonedDateTime.default ChronoLocalDateChronology. dateNow(ZoneId zone)Obtains the current local date in this chronology from the system clock in the specified time-zone.LocalDateIsoChronology. dateNow(ZoneId zone)Obtains the current ISO local date from the system clock in the specified time-zone.static HijrahDateHijrahDate. now(ZoneId zone)Obtains the currentHijrahDateof the Islamic Umm Al-Qura calendar in the specified time-zone.static JapaneseDateJapaneseDate. now(ZoneId zone)Obtains the currentJapaneseDatefrom the system clock in the specified time-zone.static MinguoDateMinguoDate. now(ZoneId zone)Obtains the currentMinguoDatefrom the system clock in the specified time-zone.static ThaiBuddhistDateThaiBuddhistDate. now(ZoneId zone)Obtains the currentThaiBuddhistDatefrom the system clock in the specified time-zone.ChronoZonedDateTime<D>ChronoZonedDateTime. withZoneSameInstant(ZoneId zone)Returns a copy of this date-time with a different time-zone, retaining the instant.ChronoZonedDateTime<D>ChronoZonedDateTime. withZoneSameLocal(ZoneId zone)Returns a copy of this date-time with a different time-zone, retaining the local date-time if possible.default ChronoZonedDateTime<? extends ChronoLocalDate>Chronology. zonedDateTime(Instant instant, ZoneId zone)Obtains aChronoZonedDateTimein this chronology from anInstant.ZonedDateTimeIsoChronology. zonedDateTime(Instant instant, ZoneId zone)Obtains an ISO zoned date-time in this chronology from anInstant. -
Uses of ZoneId in java.time.format
Methods in java.time.format that return ZoneId Modifier and Type Method Description ZoneIdDateTimeFormatter. getZone()Gets the overriding zone to be used during formatting.Methods in java.time.format with parameters of type ZoneId Modifier and Type Method Description DateTimeFormatterDateTimeFormatter. withZone(ZoneId zone)Returns a copy of this formatter with a new override zone.Method parameters in java.time.format with type arguments of type ZoneId Modifier and Type Method Description DateTimeFormatterBuilderDateTimeFormatterBuilder. appendGenericZoneText(TextStyle textStyle, Set<ZoneId> preferredZones)Appends the generic time-zone name, such as 'Pacific Time', to the formatter.DateTimeFormatterBuilderDateTimeFormatterBuilder. appendZoneText(TextStyle textStyle, Set<ZoneId> preferredZones)Appends the time-zone name, such as 'British Summer Time', to the formatter. -
Uses of ZoneId in java.time.temporal
Methods in java.time.temporal that return types with arguments of type ZoneId Modifier and Type Method Description static TemporalQuery<ZoneId>TemporalQueries. zone()A lenient query for theZoneId, falling back to theZoneOffset.static TemporalQuery<ZoneId>TemporalQueries. zoneId()A strict query for theZoneId. -
Uses of ZoneId in java.util
Methods in java.util that return ZoneId Modifier and Type Method Description ZoneIdTimeZone. toZoneId()Converts thisTimeZoneobject to aZoneId.Methods in java.util with parameters of type ZoneId Modifier and Type Method Description static TimeZoneTimeZone. getTimeZone(ZoneId zoneId)Gets theTimeZonefor the givenzoneId.
-