-1

I tried converting this string to date time using ParseExact, but its giving exception on String format(String was not recognized as a valid DateTime)

Can someone please suggest some solution

DateTime dt = DateTime.ParseExact("2016-11-29T13:00:00", "yyyy-MM-dd'T'hh:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
Ousmane D.
  • 52,579
  • 8
  • 80
  • 117
Krunal
  • 1
  • 5

1 Answers1

4

You're parsing 24H time format. Use HH instead of hh for the hours.

Traveling Tech Guy
  • 26,026
  • 22
  • 105
  • 148