| 序號 |
方法及描述 |
| 1 |
boolean equals(Object obj)
檢查此日期時間是否等於另一個日期時間。 |
| 2 |
String format(DateTimeFormatter formatter)
使用指定的格式化程式格式化此日期時間。 |
| 3 |
static ZonedDateTime from(TemporalAccessor temporal)
從時間物件獲取 ZonedDateTime 例項。 |
| 4 |
int get(TemporalField field)
獲取此日期時間中指定欄位的值,作為 int。 |
| 5 |
int getDayOfMonth()
獲取月份中的日期欄位。 |
| 6 |
DayOfWeek getDayOfWeek()
獲取一週中的日期欄位,這是一個 DayOfWeek 列舉。 |
| 7 |
int getDayOfYear()
獲取一年中的日期欄位。 |
| 8 |
int getHour()
獲取一天中的小時欄位。 |
| 9 |
long getLong(TemporalField field)
獲取此日期時間中指定欄位的值,作為 long。 |
| 10 |
Month getMinute()
獲取小時中的分鐘欄位。 |
| 11 |
Month getMonth()
使用 Month 列舉獲取一年中的月份欄位。 |
| 12 |
int getMonthValue()
獲取一年中的月份欄位,從 1 到 12。 |
| 13 |
int getNano()
獲取秒中的納秒欄位。 |
| 14 |
ZoneOffset getOffset()
獲取時區偏移量,例如 '+01:00'。 |
| 15 |
int getSecond()
獲取分鐘中的秒欄位。 |
| 16 |
int getYear()
獲取年份欄位。 |
| 17 |
ZoneId getZone()
獲取時區,例如 'Europe/Paris'。 |
| 18 |
int hashCode()
此日期時間的雜湊碼。 |
| 19 |
boolean isSupported(TemporalField field)
檢查是否支援指定的欄位。 |
| 20 |
boolean isSupported(TemporalUnit unit)
檢查是否支援指定的單位。 |
| 21 |
ZonedDateTime minus(long amountToSubtract, TemporalUnit unit)
返回此日期時間的副本,減去指定量。 |
| 22 |
ZonedDateTime minus(TemporalAmount amountToSubtract)
返回此日期時間的副本,減去指定量。 |
| 23 |
ZonedDateTime minusDays(long daysToSubtract)
返回此 ZonedDateTime 的副本,減去指定的天數。 |
| 24 |
ZonedDateTime minusHours(long hoursToSubtract)
返回此 ZonedDateTime 的副本,減去指定的小時數。 |
| 25 |
ZonedDateTime minusMinutes(long minutesToSubtract)
返回此 ZonedDateTime 的副本,減去指定的分鐘數。 |
| 26 |
ZonedDateTime minusMonths(long monthsToSubtract)
返回此 ZonedDateTime 的副本,減去指定的月數。 |
| 27 |
ZonedDateTime minusNanos(long nanos)
返回此 ZonedDateTime 的副本,減去指定的納秒數。 |
| 28 |
ZonedDateTime minusSeconds(long seconds)
返回此 ZonedDateTime 的副本,減去指定的秒數。 |
| 29 |
ZonedDateTime minusWeeks(long weeksToSubtract)
返回此 ZonedDateTime 的副本,減去指定的週數。 |
| 30 |
ZonedDateTime minusYears(long yearsToSubtract)
返回此 ZonedDateTime 的副本,減去指定的年數。 |
| 31 |
static ZonedDateTime now()
從系統時鐘的預設時區獲取當前日期時間。 |
| 32 |
static ZonedDateTime now(Clock clock)
從指定的時鐘獲取當前日期時間。 |
| 33 |
static ZonedDateTime now(ZoneId zone)
從系統時鐘的指定時區獲取當前日期時間。 |
| 34 |
static ZonedDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneId zone)
從年、月、日、時、分、秒、納秒和時區獲取 ZonedDateTime 例項。 |
| 35 |
static ZonedDateTime of(LocalDate date, LocalTime time, ZoneId zone)
從日期和時間獲取 ZonedDateTime 例項。 |
| 36 |
static ZonedDateTime of(LocalDateTime date, ZoneId zone)
從本地日期時間獲取 ZonedDateTime 例項。 |
| 37 |
static ZonedDateTime ofInstant(Instant instant, ZoneId zone)
從 Instant 和時區 ID 獲取 ZonedDateTime 例項。 |
| 38 |
static ZonedDateTime ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)
從結合本地日期時間和偏移量形成的 Instant 獲取 ZonedDateTime 例項。 |
| 39 |
static ZonedDateTime ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset)
如果可能,從本地日期時間使用首選偏移量獲取 ZonedDateTime 例項。 |
| 40 |
static ZonedDateTime ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)
嚴格驗證本地日期時間、偏移量和時區 ID 組合,獲取 ZonedDateTime 例項。 |
| 41 |
static ZonedDateTime parse(CharSequence text)
從文字字串(例如 2007-12-03T10:15:30+01:00[Europe/Paris])獲取 ZonedDateTime 例項。 |
| 42 |
static ZonedDateTime parse(CharSequence text, DateTimeFormatter formatter)
使用特定格式化程式從文字字串獲取 ZonedDateTime 例項。 |
| 43 |
ZonedDateTime plus(long amountToAdd, TemporalUnit unit)
返回此日期時間的副本,加上指定量。 |
| 44 |
ZonedDateTime plus(TemporalAmount amountToAdd)
返回此日期時間的副本,加上指定量。 |
| 45 |
ZonedDateTime plusDays(long daysToAdd)
返回此 ZonedDateTime 的副本,加上指定的天數。 |
| 46 |
ZonedDateTime plusHours(long hoursToAdd)
返回此 ZonedDateTime 的副本,加上指定的小時數。 |
| 47 |
ZonedDateTime plusMinutes(long minutesToAdd)
返回此 ZonedDateTime 的副本,加上指定的分鐘數。 |
| 48 |
ZonedDateTime plusMonths(long monthsToAdd)
返回此 ZonedDateTime 的副本,加上指定的月數。 |
| 49 |
ZonedDateTime plusNanos(long nanos)
返回此 ZonedDateTime 的副本,加上指定的納秒數。 |
| 50 |
ZonedDateTime plusSeconds(long seconds)
返回此 ZonedDateTime 的副本,加上指定的秒數。 |
| 51 |
ZonedDateTime plusWeeks(long weeksToAdd)
返回此 ZonedDateTime 的副本,加上指定的週數。 |
| 52 |
ZonedDateTime plusYears(long yearsToAdd)
返回此 ZonedDateTime 的副本,加上指定的年數。 |
| 53 |
<R> R query(TemporalQuery<R> query)
使用指定的查詢查詢此日期時間。 |
| 54 |
ValueRange range(TemporalField field)
獲取指定欄位的有效值範圍。 |
| 55 |
LocalDate toLocalDate()
獲取此日期時間的 LocalDate 部分。 |
| 56 |
LocalTime toLocalTime()
獲取此日期時間的 LocalTime 部分。 |
| 57 |
OffsetDateTime toOffsetDateTime()
將此日期時間轉換為 OffsetDateTime。 |
| 58 |
String toString()
輸出此日期作為字串,例如 2007-12-03T10:15:30+01:00[Europe/Paris]。 |
| 59 |
ZonedDateTime truncatedTo(TemporalUnit unit)
返回此 ZonedDateTime 的副本,時間被截斷。 |
| 60 |
long until(Temporal endExclusive, TemporalUnit unit)
根據指定的單位計算到另一個日期時間的時間量。 |
| 61 |
ZonedDateTime with(TemporalAdjuster adjuster)
返回此日期時間的調整副本。 |
| 62 |
ZonedDateTime with(TemporalField field, long newValue)
返回此日期時間的副本,其中指定欄位設定為新值。 |
| 63 |
ZonedDateTime withDayOfMonth(int dayOfMonth)
返回此 ZonedDateTime 的副本,其中月份中的日期已更改。 |
| 64 |
ZonedDateTime withDayOfYear(int dayOfYear)
返回此 ZonedDateTime 的副本,其中一年中的日期已更改。 |
| 65 |
ZonedDateTime withEarlierOffsetAtOverlap()
返回此日期時間的副本,將時區偏移量更改為本地時間線重疊處兩個有效偏移量中的較早者。 |
| 66 |
ZonedDateTime withFixedOffsetZone()
返回此日期時間的副本,其中時區 ID 設定為偏移量。 |
| 67 |
ZonedDateTime withHour(int hour)
返回此 ZonedDateTime 的副本,其中一天中的小時已更改。 |
| 68 |
ZonedDateTime withLaterOffsetAtOverlap()
返回此日期時間的副本,將時區偏移量更改為本地時間線重疊處兩個有效偏移量中的較晚者。 |
| 69 |
ZonedDateTime withMinute(int minute)
返回此 ZonedDateTime 的副本,其中小時中的分鐘已更改。 |
| 70 |
ZonedDateTime withMonth(int month)
返回此 ZonedDateTime 的副本,其中一年中的月份已更改。 |
| 71 |
ZonedDateTime withNano(int nanoOfSecond)
返回此 ZonedDateTime 的副本,其中秒中的納秒已更改。 |
| 72 |
ZonedDateTime withSecond(int second)
返回此 ZonedDateTime 的副本,其中分鐘中的秒已更改。 |
| 73 |
ZonedDateTime withYear(int year)
返回此 ZonedDateTime 的副本,其中年份已更改。 |
| 74 |
ZonedDateTime withZoneSameInstant(ZoneId zone)
返回此日期時間的副本,使用不同的時區,保留時間點。 |
| 75 |
ZonedDateTime withZoneSameLocal(ZoneId zone)
返回此日期時間的副本,使用不同的時區,如果可能,保留本地日期時間。 |