Mono Class Library: System.Convert Overview | Members

System.Convert.ToDateTime Method

Converts a string to a DateTime structure. [Edit]

public static DateTime ToDateTime (string value)

Parameters

value
The string to be converted. The string is in a form allowed by the DateTime.Parse(string)(string) method. [Edit]

Returns

value as a DateTime. [Edit]

Exceptions

TypeReason
ArgumentExceptionvalue is a null reference. [Edit]
FormatExceptionvalue cannot be converted to a DateTime . [Edit]

Remarks

This method parses value using the information in a System.Globalization.DateTimeFormatInfo instance initialized for the current system culture. [Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0