I am working on a project where I am reading in a file which could come in two different formats, one includes a date and time and the other doesn\'t.
When I read i
Update 2: Found out using DateTime.TryParseExact is a much better way that using Regex Expressions
DateTime myDate;
if (DateTime.TryParseExact(inputString, "dd-MM-yyyy hh:mm:ss",
CultureInfo.InvariantCulture, DateTimeStyles.None, out myDate))
{
//String has Date and Time
}
else
{
//String has only Date Portion
}