語言

TemporalQueries.ZoneId 方法

定義

對 ZoneId的嚴格查詢。

[Android.Runtime.Register("zoneId", "()Ljava/time/temporal/TemporalQuery;", "", ApiSince=26)]
public static Java.Time.Temporal.ITemporalQuery? ZoneId();
[<Android.Runtime.Register("zoneId", "()Ljava/time/temporal/TemporalQuery;", "", ApiSince=26)>]
static member ZoneId : unit -> Java.Time.Temporal.ITemporalQuery

傳回

一個查詢,能取得時空區域 ID,而非 null

屬性

備註

對 ZoneId的嚴格查詢。

此時查詢區域的 a TemporalAccessor 。 只有當日期-時間概念上包含 時 ZoneId,區域才會回傳。 若日期時間僅概念上有 ZoneOffset。 因此 a java.time.ZonedDateTime 會回傳 的 getZone()結果,但 a java.time.OffsetDateTime 會回傳 null。

大多數情況下,應用程式應該使用 #zone() ,因為這個查詢過於嚴格。

JDK 類別實作TemporalAccessor的結果如下:<br>LocalDate 返回 null<br>LocalTime 返回 null<br>LocalDateTime 返回 null<br>ZonedDateTime 返回 相關區域<brOffsetTime> 返回 null<br>OffsetDateTime 返回 null<>ChronoLocalDate br 返回 null>ChronoLocalDateTime<<>ChronoZonedDateTime br 返回 null br 返回 關聯區域<brEra> 返回 null brDayOfWeek<><>Month<回傳 null<BRYearMonth> 回傳 null<BR>MonthDay 回傳 null<BRZoneOffset> 回傳 null><Instant BR 回傳 null BR<>Year>

的 java.time.temporal.TemporalQueries.zoneId()Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於