語言

ZoneRules.GetOffset 方法

定義

多載

名稱 Description
GetOffset(Instant)

取得這些規則中指定時刻適用的偏移量。

GetOffset(LocalDateTime)

在這些規則中,會根據指定的當地日期時間獲得適當的偏移量。

GetOffset(Instant)

取得這些規則中指定時刻適用的偏移量。

[Android.Runtime.Register("getOffset", "(Ljava/time/Instant;)Ljava/time/ZoneOffset;", "", ApiSince=26)]
public Java.Time.ZoneOffset? GetOffset(Java.Time.Instant? instant);
[<Android.Runtime.Register("getOffset", "(Ljava/time/Instant;)Ljava/time/ZoneOffset;", "", ApiSince=26)>]
member this.GetOffset : Java.Time.Instant -> Java.Time.ZoneOffset

參數

instant
Instant

找到偏移量的瞬間。 固定偏移規則可忽略 null;變數規則則不行。

傳回

該偏移量在指定時刻適用。

屬性

例外狀況

如果 instantnull 且規則不是固定偏移,則會被拋出。

適用於

GetOffset(LocalDateTime)

在這些規則中,會根據指定的當地日期時間獲得適當的偏移量。

[Android.Runtime.Register("getOffset", "(Ljava/time/LocalDateTime;)Ljava/time/ZoneOffset;", "", ApiSince=26)]
public Java.Time.ZoneOffset? GetOffset(Java.Time.LocalDateTime? localDateTime);
[<Android.Runtime.Register("getOffset", "(Ljava/time/LocalDateTime;)Ljava/time/ZoneOffset;", "", ApiSince=26)>]
member this.GetOffset : Java.Time.LocalDateTime -> Java.Time.ZoneOffset

參數

localDateTime
LocalDateTime

查詢的當地日期時間。 固定偏移規則可忽略 null;變數規則則不行。

傳回

當地日期時間的最佳可選偏移;對於間隙或重疊,則是指轉換前的偏移量。

屬性

例外狀況

如果 localDateTimenull 且規則不是固定偏移,則會被拋出。

適用於