I am developing a Windows application.
That I have a date in a string format like → fileDate="15/03/2013"
I want it to be converted to a date format, since the field is my database datetime.
I used the following things for this →
DateTime dt = DateTime.ParseExact(fileDate, "yyyyy-DD-MM", CultureInfo.InvariantCulture);
DateTime dt = DateTime.Parse(fileDate);
Both of these methods were unsuccessful, giving me an error →
String was not recognized as a valid DateTime.
What could be a mistake?
Is there any other way to do this?
user2176240
source
share