If you know that the string is always formatted in a specific format use the
DateTime.ParseExact Method (String, String, IFormatProvider) (System)[
^] or the
DateTime.TryParseExact
method.
If you know the culture settings that has been used when creating the string, use one the
DateTime.Parse Method (System)[
^] or the corresponding
TryParse
methods that accepts a culture info parameter.
In all other cases it not possible to convert strings to dates.
To avoid date conversion problems store them in binary format whenever possible or use a defined format (fixed or stored/passed as additional argument).