I am trying to parse a "31.01.2017 07:56:29.470000000"
date time string in datetime format.
Used code:
DateTime requiredDate;
string date = "31.01.2017 07:56:29.470000000";
DateTime.TryParseExact(date,
"dd.MM.yyyy hh:mm:ss.fffffff",
CultureInfo.InvariantCulture,
DateTimeStyles.None,
out requiredDate);
NOTE: the date string is exact "01/31/2017 07: 56: 29.470000000", however, if I use "01/31/2017 07: 56: 29.4700000", then it works fine.
Please analyze "01/31/2017 07: 56: 29.470000000".
source
share