语言

JsonElement.GetDateTime 方法

定义

获取元素的值作为一个 DateTime。

public:
 DateTime GetDateTime();
public DateTime GetDateTime();
member this.GetDateTime : unit -> DateTime
Public Function GetDateTime () As DateTime

返回

作为 . DateTime的元素的值。

例外

不能将值读取为 .DateTime

JsonDocument父级已被释放。

注解

此方法仅创建符合 ISO 8601-1 扩展格式的 JSON 字符串的 DateTime 表示形式(请参阅 System.Text.Json 中的 DateTime 和 DateTimeOffset 支持)。

适用于

另请参阅