The code:
DateTime.ParseExact("2/2/2002", "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture)
is raising System.FormatException
.
I'll really appreciate if anybody could tell me what am I doing wrong.
The code:
DateTime.ParseExact("2/2/2002", "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture)
is raising System.FormatException
.
I'll really appreciate if anybody could tell me what am I doing wrong.
it should be d/M/yyyy
DateTime.ParseExact("2/2/2002", "d/M/yyyy", System.Globalization.CultureInfo.InvariantCulture)
the reason of exception is that it converts two places for dd
but the string found is 2/
.