If you know the date / time format exactly (i.e. it never changes and does not depend on the culture or locale of the user), you can use DateTime.TryParseExact.
For instance:
DateTime result;
if (DateTime.TryParseExact(
str,
"dd-MM-yyyy",
CultureInfo.InvariantCulture,
DateTimeStyles.None,
out result))
{
}
(, dd-MM-yyyy) (, g). , . , 26-07-2012 (dd-MM-yyyy), 7/26/2012 (M/d/yyyy).
, str , . , . , . (regex) # . . , , d/M/yyyy, \d{1,2}\/\d{1,2}\/\d{4}.