Method Summary
Public Methods | ||
public |
compareTo(other: ChronoZonedDateTime): number Compares this date-time to another date-time, including the chronology. |
|
public |
Checks if this date-time is equal to another date-time. |
|
public |
format(formatter: DateTimeFormatter): string Outputs this date-time as a {@code String} using the formatter. |
|
public |
isAfter(other: ChronoZonedDateTime): boolean Checks if the instant of this date-time is after that of the specified date-time. |
|
public |
isBefore(other: ChronoZonedDateTime): boolean Checks if the instant of this date-time is before that of the specified date-time. |
|
public |
isEqual(other: ChronoZonedDateTime): boolean Checks if the instant of this date-time is equal to that of the specified date-time. |
|
public |
query(query: *): * |
|
public |
Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z. |
|
public |
Converts this date-time to an {@code Instant}. |
Inherited Summary
From class TemporalAccessor | ||
public |
get(field: TemporalField): number Gets the value of the specified field as an {@code int}. |
|
public |
query(query: TemporalQuery): * Queries this date-time. |
|
public |
range(field: TemporalField): ValueRange Gets the range of valid values for the specified field. |
Public Methods
public compareTo(other: ChronoZonedDateTime): number source
Compares this date-time to another date-time, including the chronology.
The comparison is based first on the instant, then on the local date-time, then on the zone ID, then on the chronology. It is "consistent with equals", as defined by Comparable.
If all the date-time objects being compared are in the same chronology, then the additional chronology stage is not required.
Params:
Name | Type | Attribute | Description |
other | ChronoZonedDateTime | the other date-time to compare to, not null |
public equals(other: *): boolean source
Checks if this date-time is equal to another date-time.
The comparison is based on the offset date-time and the zone. To compare for the same instant on the time-line, use #compareTo. Only objects of type {@code ChronoZoneDateTime} are compared, other types return false.
Params:
Name | Type | Attribute | Description |
other | * | the object to check, null returns false |
public format(formatter: DateTimeFormatter): string source
Outputs this date-time as a {@code String} using the formatter.
Params:
Name | Type | Attribute | Description |
formatter | DateTimeFormatter | the formatter to use, not null |
Throw:
* |
DateTimeException if an error occurs during printing |
public isAfter(other: ChronoZonedDateTime): boolean source
Checks if the instant of this date-time is after that of the specified date-time.
This method differs from the comparison in #compareTo in that it only compares the instant of the date-time. This is equivalent to using {@code dateTime1.toInstant().isAfter(dateTime2.toInstant());}.
Params:
Name | Type | Attribute | Description |
other | ChronoZonedDateTime |
|
the other date-time to compare to, not null |
public isBefore(other: ChronoZonedDateTime): boolean source
Checks if the instant of this date-time is before that of the specified date-time.
This method differs from the comparison in #compareTo in that it only compares the instant of the date-time. This is equivalent to using {@code dateTime1.toInstant().isBefore(dateTime2.toInstant());}.
Params:
Name | Type | Attribute | Description |
other | ChronoZonedDateTime |
|
the other date-time to compare to, not null |
public isEqual(other: ChronoZonedDateTime): boolean source
Checks if the instant of this date-time is equal to that of the specified date-time.
This method differs from the comparison in #compareTo and #equals in that it only compares the instant of the date-time. This is equivalent to using {@code dateTime1.toInstant().equals(dateTime2.toInstant());}.
Params:
Name | Type | Attribute | Description |
other | ChronoZonedDateTime |
|
the other date-time to compare to, not null |
public query(query: *): * source
Override:
TemporalAccessor#queryParams:
Name | Type | Attribute | Description |
query | * |
Return:
* |
public toEpochSecond(): number source
Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.
This uses the {@linkplain #toLocalDateTime() local date-time} and {@linkplain #getOffset() offset} to calculate the epoch-second value, which is the number of elapsed seconds from 1970-01-01T00:00:00Z. Instants on the time-line after the epoch are positive, earlier are negative.