JsonElement.GetDateTimeOffset Metoda

Definicja

Pobiera wartość elementu jako DateTimeOffset.

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

Zwraca

Wartość elementu jako DateTimeOffset.

Wyjątki

Ta wartość ValueKind nie Stringjest .

Nie można odczytać wartości jako DateTimeOffset.

Element nadrzędny JsonDocument został usunięty.

Uwagi

Ta metoda tworzy tylko reprezentację ciągów JSON typu DateTimeOffset, które są zgodne z rozszerzonym formatem ISO 8601-1 (zobacz Obsługa formatu DateTime i DateTimeOffset w pliku System.Text.Json).

Dotyczy