JsonElement.TryGetDateTime(DateTime) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
嘗試將目前的 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
參數
傳回
true若字串可表示為DateTime;否則,。 false
例外狀況
父母 JsonDocument 已被處理掉。
備註
此方法僅建立符合 ISO 8601-1 擴展格式的 JSON 字串 DateTime 表示(參見 System.Text.JSON 中的 DateTime 與 DateTimeOffset 支援)。