Language

JsonElement.TryGetDateTime(DateTime) メソッド

定義

現在の JSON 文字列を DateTimeとして表そうとします。

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

パラメーター

value
DateTime

このメソッドから制御が戻るときに、変換に成功した場合は現在の JSON 文字列と等価の日付と時刻の値を格納し、変換に失敗した場合は MinValue します。

返品

true 文字列を DateTimeとして表すことができる場合は。それ以外の場合は false。

例外

この値の ValueKind は Stringされません。

親 JsonDocument が破棄されました。

注釈

このメソッドは、ISO 8601-1 拡張形式に準拠する JSON 文字列の DateTime 表現のみを作成します ( System.Text.Json での DateTime および DateTimeOffset のサポートを参照)。

適用対象