JObjectExtensions.GetDateTime method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Json.Extensions
Assembly Skybrud.Essentials.dll

GetDateTime(JObject, string)

Extension method

Gets an instance of DateTime from the value of the token matching the specified path.

public static DateTime GetDateTime(this JObject obj, string path)

Parameters

obj JObject

The instance of JObject .

path String

A String that contains a JPath expression.

Returns

An instance of DateTime representing the value of the property.

GetDateTime(JObject, string, DateTimeStyles)

Extension method

Gets an instance of DateTime from the value of the token matching the specified path.

public static DateTime GetDateTime(this JObject obj, string path, DateTimeStyles styles)

Parameters

obj JObject

The instance of JObject .

path String

A String that contains a JPath expression.

A bitwise combination of the enumeration values that indicates the style elements that can be present in the property value for the parse operation to succeed and that defines how to interpret the parsed date in relation to the current time zone or the current date. A typical value to specify is System.Globalization.DateTimeStyles.None.

Returns

An instance of DateTime representing the value of the property.

GetDateTime(JObject, string, IFormatProvider, DateTimeStyles)

Extension method

Gets an instance of DateTime from the value of the token matching the specified path.

public static DateTime GetDateTime(this JObject obj, string path, IFormatProvider provider, DateTimeStyles styles)

Parameters

obj JObject

The instance of JObject .

path String

A String that contains a JPath expression.

provider IFormatProvider

An object that supplies culture-specific formatting information about the property value.

A bitwise combination of the enumeration values that indicates the style elements that can be present in the property value for the parse operation to succeed and that defines how to interpret the parsed date in relation to the current time zone or the current date. A typical value to specify is System.Globalization.DateTimeStyles.None.

Returns

An instance of DateTime representing the value of the property.