Method ToDateTime
ToDateTime()
Attempts to convert JSON value to DateTime with standard format and culture.
Declaration
public DateTime ToDateTime()
Returns
Type | Description |
---|---|
System.DateTime | Converted DateTime value. |
Exceptions
Type | Condition |
---|---|
System.FormatException | The exception that is thrown when the format of an argument is invalid or when a composite format string is not well formed. |
System.ArgumentNullException | The exception that is thrown when a null reference (nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. |
ToDateTime(String, IFormatProvider)
Attempts to convert JSON value to DateTime with provided format.
Declaration
public DateTime ToDateTime(string format, IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | DateTime format for conversion. |
System.IFormatProvider | provider | Format control for DateTime. |
Returns
Type | Description |
---|---|
System.DateTime | Converted DateTime value. |
Exceptions
Type | Condition |
---|---|
System.FormatException | The exception that is thrown when the format of an argument is invalid, or when a composite format string is not well formed. |
System.ArgumentNullException | The exception that is thrown when a null reference (nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. |