@PublicEvolving public final class ZonedTimestampData extends Object implements Comparable<ZonedTimestampData>
ZonedTimestampType. It aims to converting
various Java time representations into the date-time in a particular time zone.
The ISO date-time format is used by default, it includes the date, time (including fractional parts), and offset from UTC, such as '2011-12-03T10:15:30+01:00'.
| 限定符和类型 | 字段和说明 |
|---|---|
static java.time.format.DateTimeFormatter |
ISO_FORMATTER
The ISO date-time format includes the date, time (including fractional parts), and offset
from UTC, such as '2011-12-03T10:15:30.030431+01:00'.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(ZonedTimestampData that) |
boolean |
equals(Object obj) |
static ZonedTimestampData |
fromOffsetDateTime(java.time.OffsetDateTime offsetDateTime)
Creates an instance of
ZonedTimestampData from an instance of LocalDateTime. |
static ZonedTimestampData |
fromZonedDateTime(java.time.ZonedDateTime zonedDateTime)
Creates an instance of
ZonedTimestampData from an instance of LocalDateTime. |
java.time.LocalDateTime |
getLocalDateTimePart()
Returns the
LocalDateTime part of this zoned date-time. |
long |
getMillisecond()
Returns the number of milliseconds since
1970-01-01 00:00:00. |
int |
getNanoOfMillisecond()
Returns the number of nanoseconds (the nanoseconds within the milliseconds).
|
java.time.ZoneId |
getTimeZoneId()
Returns the
ZoneId part of this zoned date-time. |
java.time.ZonedDateTime |
getZonedDateTime()
Returns the zoned date-time with time-zone.
|
String |
getZoneId()
Returns the
ZoneId string of this zoned date-time. |
int |
hashCode() |
static boolean |
isCompact(int precision)
Returns whether the date-time part is small enough to be stored in a long of milliseconds.
|
static ZonedTimestampData |
of(long millisecond,
int nanoOfMillisecond,
String zoneId)
Creates an instance of
ZonedTimestampData from milliseconds and nanos-of-millisecond
with the given zoneId. |
java.time.Instant |
toInstant()
Converts this
ZonedTimestampData object to a Instant. |
String |
toString() |
Timestamp |
toTimestamp()
Converts this
ZonedTimestampData object to a Timestamp. |
public static final java.time.format.DateTimeFormatter ISO_FORMATTER
public java.time.ZonedDateTime getZonedDateTime()
public java.time.Instant toInstant()
ZonedTimestampData object to a Instant.public Timestamp toTimestamp()
ZonedTimestampData object to a Timestamp.public long getMillisecond()
1970-01-01 00:00:00.public int getNanoOfMillisecond()
The value range is from 0 to 999,999.
public java.time.LocalDateTime getLocalDateTimePart()
LocalDateTime part of this zoned date-time.public java.time.ZoneId getTimeZoneId()
ZoneId part of this zoned date-time.public String getZoneId()
ZoneId string of this zoned date-time.public int compareTo(ZonedTimestampData that)
compareTo 在接口中 Comparable<ZonedTimestampData>public static ZonedTimestampData fromZonedDateTime(java.time.ZonedDateTime zonedDateTime)
ZonedTimestampData from an instance of LocalDateTime.zonedDateTime - an instance of ZonedDateTimepublic static ZonedTimestampData fromOffsetDateTime(java.time.OffsetDateTime offsetDateTime)
ZonedTimestampData from an instance of LocalDateTime.offsetDateTime - an instance of OffsetDateTimepublic static ZonedTimestampData of(long millisecond, int nanoOfMillisecond, String zoneId)
ZonedTimestampData from milliseconds and nanos-of-millisecond
with the given zoneId.millisecond - the number of millisecondsnanoOfMillisecond - the nanosecondszoneId - the zoneId stringpublic static boolean isCompact(int precision)
Copyright © 2025 The Apache Software Foundation. All rights reserved.