| 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, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).
|
| Modifier and Type | Class and Description |
|---|---|
class |
ZoneOffset
A time-zone offset from Greenwich/UTC, such as
+02:00.
|
| Modifier and Type | Method and Description |
|---|---|
static ZoneId |
ZoneId.from(TemporalAccessor
Obtains an instance of
ZoneId from a temporal object.
|
abstract ZoneId |
Clock.getZone()
Gets the time-zone being used to create dates and times.
|
ZoneId |
ZonedDateTime.getZone()
Gets the time-zone, such as 'Europe/Paris'.
|
ZoneId |
ZoneId.normalized()
Normalizes the time-zone ID, returning a
ZoneOffset where possible.
|
static ZoneId |
ZoneId.of(String
Obtains an instance of
ZoneId from an ID ensuring that the ID is valid and available for use.
|
static ZoneId |
ZoneId.of(String
Obtains an instance of
ZoneId using its ID using a map of aliases to supplement the standard zone IDs.
|
static ZoneId |
ZoneId.ofOffset(String
Obtains an instance of
ZoneId wrapping an offset.
|
static ZoneId |
ZoneId.systemDefault()
Gets the system default time-zone.
|
| Modifier and Type | Method and Description |
|---|---|
ZonedDateTime |
LocalDate.atStartOfDay(ZoneId
Returns a zoned date-time from this date at the earliest valid time according to the rules in the time-zone.
|
ZonedDateTime |
LocalDateTime.atZone(ZoneId
Combines this date-time with a time-zone to create a
ZonedDateTime.
|
ZonedDateTime |
Instant.atZone(ZoneId
Combines this instant with a time-zone to create a
ZonedDateTime.
|
ZonedDateTime |
OffsetDateTime.atZoneSameInstant(ZoneId
Combines this date-time with a time-zone to create a
ZonedDateTime ensuring that the result has the same instant.
|
ZonedDateTime |
OffsetDateTime.atZoneSimilarLocal(ZoneId
Combines this date-time with a time-zone to create a
ZonedDateTime trying to keep the same local date and time.
|
static Clock |
Clock.fixed(Instant
Obtains a clock that always returns the same instant.
|
static LocalTime |
LocalTime.now(ZoneId
Obtains the current time from the system clock in the specified time-zone.
|
static YearMonth |
YearMonth.now(ZoneId
Obtains the current year-month from the system clock in the specified time-zone.
|
static LocalDate |
LocalDate.now(ZoneId
Obtains the current date from the system clock in the specified time-zone.
|
static OffsetTime |
OffsetTime.now(ZoneId
Obtains the current time from the system clock in the specified time-zone.
|
static Year |
Year.now(ZoneId
Obtains the current year from the system clock in the specified time-zone.
|
static ZonedDateTime |
ZonedDateTime.now(ZoneId
Obtains the current date-time from the system clock in the specified time-zone.
|
static OffsetDateTime |
OffsetDateTime.now(ZoneId
Obtains the current date-time from the system clock in the specified time-zone.
|
static LocalDateTime |
LocalDateTime.now(ZoneId
Obtains the current date-time from the system clock in the specified time-zone.
|
static MonthDay |
MonthDay.now(ZoneId
Obtains the current month-day from the system clock in the specified time-zone.
|
static ZonedDateTime |
ZonedDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneId
Obtains an instance of
ZonedDateTime from a year, month, day, hour, minute, second, nanosecond and time-zone.
|
static ZonedDateTime |
ZonedDateTime.of(LocalDate
Obtains an instance of
ZonedDateTime from a local date and time.
|
static ZonedDateTime |
ZonedDateTime.of(LocalDateTime
Obtains an instance of
ZonedDateTime from a local date-time.
|
static OffsetTime |
OffsetTime.ofInstant(Instant
Obtains an instance of
OffsetTime from an
Instant and zone ID.
|
static ZonedDateTime |
ZonedDateTime.ofInstant(Instant
Obtains an instance of
ZonedDateTime from an
Instant.
|
static OffsetDateTime |
OffsetDateTime.ofInstant(Instant
Obtains an instance of
OffsetDateTime from an
Instant and zone ID.
|
static LocalDateTime |
LocalDateTime.ofInstant(Instant
Obtains an instance of
LocalDateTime from an
Instant and zone ID.
|
static ZonedDateTime |
ZonedDateTime.ofInstant(LocalDateTime
Obtains an instance of
ZonedDateTime from the instant formed by combining the local date-time and offset.
|
static ZonedDateTime |
ZonedDateTime.ofLocal(LocalDateTime
Obtains an instance of
ZonedDateTime from a local date-time using the preferred offset if possible.
|
static ZonedDateTime |
ZonedDateTime.ofStrict(LocalDateTime
Obtains an instance of
ZonedDateTime strictly validating the combination of local date-time, offset and zone ID.
|
static Clock |
Clock.system(ZoneId
Obtains a clock that returns the current instant using best available system clock.
|
static Clock |
Clock.tickMinutes(ZoneId
Obtains a clock that returns the current instant ticking in whole minutes using best available system clock.
|
static Clock |
Clock.tickSeconds(ZoneId
Obtains a clock that returns the current instant ticking in whole seconds using best available system clock.
|
abstract Clock |
Clock.withZone(ZoneId
Returns a copy of this clock with a different time-zone.
|
ZonedDateTime |
ZonedDateTime.withZoneSameInstant(ZoneId
Returns a copy of this date-time with a different time-zone, retaining the instant.
|
ZonedDateTime |
ZonedDateTime.withZoneSameLocal(ZoneId
Returns a copy of this date-time with a different time-zone, retaining the local date-time if possible.
|
| Modifier and Type | Method and Description |
|---|---|
ZoneId |
ChronoZonedDateTime.getZone()
Gets the zone ID, such as 'Europe/Paris'.
|
| Modifier and Type | Method and Description |
|---|---|
ChronoZonedDateTime |
ChronoLocalDateTime.atZone(ZoneId
Combines this time with a time-zone to create a
ChronoZonedDateTime.
|
HijrahDate |
HijrahChronology.dateNow(ZoneId
|
ThaiBuddhistDate |
ThaiBuddhistChronology.dateNow(ZoneId
|
default ChronoLocalDate |
Chronology.dateNow(ZoneId
Obtains the current local date in this chronology from the system clock in the specified time-zone.
|
LocalDate |
IsoChronology.dateNow(ZoneId
Obtains the current ISO local date from the system clock in the specified time-zone.
|
MinguoDate |
MinguoChronology.dateNow(ZoneId
|
JapaneseDate |
JapaneseChronology.dateNow(ZoneId
|
static JapaneseDate |
JapaneseDate.now(ZoneId
Obtains the current
JapaneseDate from the system clock in the specified time-zone.
|
static HijrahDate |
HijrahDate.now(ZoneId
Obtains the current
HijrahDate of the Islamic Umm Al-Qura calendar in the specified time-zone.
|
static ThaiBuddhistDate |
ThaiBuddhistDate.now(ZoneId
Obtains the current
ThaiBuddhistDate from the system clock in the specified time-zone.
|
static MinguoDate |
MinguoDate.now(ZoneId
Obtains the current
MinguoDate from the system clock in the specified time-zone.
|
ChronoZonedDateTime |
ChronoZonedDateTime.withZoneSameInstant(ZoneId
Returns a copy of this date-time with a different time-zone, retaining the instant.
|
ChronoZonedDateTime |
ChronoZonedDateTime.withZoneSameLocal(ZoneId
Returns a copy of this ZonedDateTime with a different time-zone, retaining the local date-time if possible.
|
ChronoZonedDateTime |
HijrahChronology.zonedDateTime(Instant
|
ChronoZonedDateTime |
ThaiBuddhistChronology.zonedDateTime(Instant
|
default ChronoZonedDateTime |
Chronology.zonedDateTime(Instant
Obtains a
ChronoZonedDateTime in this chronology from an
Instant.
|
ZonedDateTime |
IsoChronology.zonedDateTime(Instant
Obtains an ISO zoned date-time in this chronology from an
Instant.
|
ChronoZonedDateTime |
MinguoChronology.zonedDateTime(Instant
|
ChronoZonedDateTime |
JapaneseChronology.zonedDateTime(Instant
|
| Modifier and Type | Method and Description |
|---|---|
ZoneId |
DateTimeFormatter.getZone()
Gets the overriding zone to be used during formatting.
|
| Modifier and Type | Method and Description |
|---|---|
DateTimeFormatter |
DateTimeFormatter.withZone(ZoneId
Returns a copy of this formatter with a new override zone.
|
| Modifier and Type | Method and Description |
|---|---|
DateTimeFormatterBuilder |
DateTimeFormatterBuilder.appendZoneText(TextStyle
Appends the time-zone name, such as 'British Summer Time', to the formatter.
|
| Modifier and Type | Method and Description |
|---|---|
static TemporalQuery |
TemporalQueries.zone()
A lenient query for the
ZoneId, falling back to the
ZoneOffset.
|
static TemporalQuery |
TemporalQueries.zoneId()
A strict query for the
ZoneId.
|
| Modifier and Type | Method and Description |
|---|---|
ZoneId |
TimeZone.toZoneId()
Converts this
TimeZone object to a
ZoneId.
|
| Modifier and Type | Method and Description |
|---|---|
static TimeZone |
TimeZone.getTimeZone(ZoneId
Gets the
TimeZone for the given
zoneId.
|