@PublicEvolving public final class LocalZonedTimestampData extends Object implements Comparable<LocalZonedTimestampData>
LocalZonedTimestampType.
This data structure is immutable and consists of a epoch milliseconds and epoch
nanos-of-millisecond since epoch 1970-01-01 00:00:00. It might be stored in a compact
representation (as a long value) if values are small enough.
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(LocalZonedTimestampData that) |
boolean |
equals(Object obj) |
static LocalZonedTimestampData |
fromEpochMillis(long millisecond)
Creates an instance of
LocalZonedTimestampData from epoch milliseconds. |
static LocalZonedTimestampData |
fromEpochMillis(long millisecond,
int epochNanoOfMillisecond)
Creates an instance of
LocalZonedTimestampData from epoch milliseconds and a epoch
nanos-of-millisecond. |
static LocalZonedTimestampData |
fromInstant(java.time.Instant instant)
Creates an instance of
LocalZonedTimestampData from an instance of Instant. |
long |
getEpochMillisecond()
Returns the number of epoch milliseconds since epoch
1970-01-01 00:00:00. |
int |
getEpochNanoOfMillisecond()
Returns the number of epoch nanoseconds (the nanoseconds within the milliseconds).
|
int |
hashCode() |
static boolean |
isCompact(int precision)
Returns whether the local zoned timestamp data is small enough to be stored in a long of
milliseconds.
|
java.time.Instant |
toInstant()
Converts this
LocalZonedTimestampData object to a Instant. |
String |
toString() |
public long getEpochMillisecond()
1970-01-01 00:00:00.public int getEpochNanoOfMillisecond()
The value range is from 0 to 999,999.
public java.time.Instant toInstant()
LocalZonedTimestampData object to a Instant.public int compareTo(LocalZonedTimestampData that)
compareTo 在接口中 Comparable<LocalZonedTimestampData>public static LocalZonedTimestampData fromEpochMillis(long millisecond)
LocalZonedTimestampData from epoch milliseconds.
The nanos-of-millisecond field will be set to zero.
millisecond - the number of epoch milliseconds since epoch 1970-01-01 00:00:00;
a negative number is the number of epoch milliseconds before epoch 1970-01-01
00:00:00public static LocalZonedTimestampData fromEpochMillis(long millisecond, int epochNanoOfMillisecond)
LocalZonedTimestampData from epoch milliseconds and a epoch
nanos-of-millisecond.millisecond - the number of epoch milliseconds since epoch 1970-01-01 00:00:00;
a negative number is the number of epoch milliseconds before epoch 1970-01-01
00:00:00epochNanoOfMillisecond - the epoch nanoseconds within the millisecond, from 0 to 999,999public static LocalZonedTimestampData fromInstant(java.time.Instant instant)
LocalZonedTimestampData from an instance of Instant.instant - an instance of Instantpublic static boolean isCompact(int precision)
Copyright © 2025 The Apache Software Foundation. All rights reserved.