I have the following code snippet
DateTime date1;
CultureInfo neutralCulture = new CultureInfo("fr");
bool isNeutral = neutralCulture.IsNeutralCulture;
DateTime.TryParse("not a date", neutralCulture, DateTimeStyles.AdjustToUniversal, out date1);
Which is done without exception, but the documentation states
NotSupportedException: The provider is a neutral culture of a and cannot be used in a parsing operation.
"fr"is a neutral culture a , as evidenced by the property above the object CultureInfo, so I expect this code to break.
What "neutral culture" violates this method - is it documented somewhere?
source
share