Utf8JsonReader.GetDateTimeOffset 方法

定義

從來源讀取下一個 JSON 權杖值,並將其剖析為 DateTimeOffset

public:
 DateTimeOffset GetDateTimeOffset();
public DateTimeOffset GetDateTimeOffset ();
member this.GetDateTimeOffset : unit -> DateTimeOffset
Public Function GetDateTimeOffset () As DateTimeOffset

傳回

日期和時間位移 (如果可以成功剖析整個 UTF-8 編碼的權杖值)。

例外狀況

JSON 權杖值不是 String

JSON 權杖值不能讀取為 DateTimeOffset

-或-

整個 UTF-8 編碼的權杖值無法剖析為 DateTimeOffset 值。

-或-

JSON 權杖值不是支援的格式。

備註

此方法只會建立 DateTimeOffset 符合 ISO 8601-1 擴充格式的 JSON 字串標記法, (請參閱 System.Text.Json) 中的 DateTime 和 DateTimeOffset 支援

適用於

另請參閱