TryParse results in a Boolean value that tells if the given string can be set as a date time value.
If that is False the out dttime will not have the desired value.
You might need the CultureInfo whle parsing:
See here[
^]
You can use a CultureInfo when trying to TryParse. Example:
string dateString;
CultureInfo culture;
DateTimeStyles styles;
DateTime dateResult;
dateString = "03/01/2009 10:00 AM";
culture = CultureInfo.CreateSpecificCulture("en-US");
styles = DateTimeStyles.None;
if (DateTime.TryParse(dateString, culture, styles, out dateResult))
Console.WriteLine("{0} converted to {1} {2}.",
dateString, dateResult, dateResult.Kind);
else
Console.WriteLine("Unable to convert {0} to a date and time.",
dateString);