JsonElement.TryGetDateTimeOffset(DateTimeOffset) Metoda

Definicja

Próbuje reprezentować bieżący ciąg JSON jako DateTimeOffset.

public:
 bool TryGetDateTimeOffset([Runtime::InteropServices::Out] DateTimeOffset % value);
public bool TryGetDateTimeOffset (out DateTimeOffset value);
member this.TryGetDateTimeOffset : DateTimeOffset -> bool
Public Function TryGetDateTimeOffset (ByRef value As DateTimeOffset) As Boolean

Parametry

value
DateTimeOffset

Gdy ta metoda zwróci wartość daty i godziny równoważną bieżącemu ciągowi JSON, jeśli konwersja zakończyła się pomyślnie lub MinValue jeśli konwersja nie powiodła się.

Zwraca

true jeśli ciąg może być reprezentowany jako DateTimeOffset; w przeciwnym razie false.

Wyjątki

Ta wartość ValueKind nie Stringjest .

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ługę formatu DateTime i DateTimeOffset w pliku System.Text.Json).

Dotyczy