Reputation: 1085
I want to convert below format in DateTime. I want to convert it to datetime
"08-22T03:32"
Upvotes: 1
Views: 127
Reputation: 20693
Since you don't have year in your date string, default will be current year, something like this :
DateTime dt = DateTime.ParseExact(dateString, "MM-ddTHH:mm", CultureInfo.InvariantCulture);
Upvotes: 5
Reputation: 911
If the string is formatted correctly, DateTime.Parse() is what you're looking for. But I think the 'date' part of that string is incomplete for it to work.
Upvotes: 0