D
- the concrete type for the date of this date-timepublic interface ChronoZonedDateTime<D extends ChronoLocalDate> extends Temporal, Comparable<ChronoZonedDateTime<?>>
Most applications should declare method signatures, fields and variables
as ZonedDateTime
, not this interface.
A ChronoZonedDateTime
is the abstract representation of an offset date-time
where the Chronology chronology
, or calendar system, is pluggable.
The date-time is defined in terms of fields expressed by TemporalField
,
where most common implementations are defined in ChronoField
.
The chronology defines how the calendar system operates and the meaning of
the standard fields.
ZonedDateTime
rather than this
interface, even in the case where the application needs to deal with multiple
calendar systems. The rationale for this is explored in detail in ChronoLocalDate
.
Ensure that the discussion in ChronoLocalDate
has been read and understood
before using this interface.
Modifier and Type | Method | Description |
---|---|---|
default int |
compareTo(ChronoZonedDateTime<?> other) |
Compares this date-time to another date-time, including the chronology.
|
boolean |
equals(Object obj) |
Checks if this date-time is equal to another date-time.
|
default String |
format(DateTimeFormatter formatter) |
Formats this date-time using the specified formatter.
|
static ChronoZonedDateTime<?> |
from(TemporalAccessor temporal) |
Obtains an instance of
ChronoZonedDateTime from a temporal object. |
default int |
get(TemporalField field) |
Gets the value of the specified field as an
int . |
default Chronology |
getChronology() |
Gets the chronology of this date-time.
|
default long |
getLong(TemporalField field) |
Gets the value of the specified field as a
long . |
ZoneOffset |
getOffset() |
Gets the zone offset, such as '+01:00'.
|
ZoneId |
getZone() |
Gets the zone ID, such as 'Europe/Paris'.
|
int |
hashCode() |
A hash code for this date-time.
|
default boolean |
isAfter(ChronoZonedDateTime<?> other) |
Checks if the instant of this date-time is after that of the specified date-time.
|
default boolean |
isBefore(ChronoZonedDateTime<?> other) |
Checks if the instant of this date-time is before that of the specified date-time.
|
default boolean |
isEqual(ChronoZonedDateTime<?> other) |
Checks if the instant of this date-time is equal to that of the specified date-time.
|
boolean |
isSupported(TemporalField field) |
Checks if the specified field is supported.
|
default boolean |
isSupported(TemporalUnit unit) |
Checks if the specified unit is supported.
|
default ChronoZonedDateTime<D> |
minus(long amountToSubtract,
TemporalUnit unit) |
Returns an object of the same type as this object with the specified period subtracted.
|
default ChronoZonedDateTime<D> |
minus( |