-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.
  • 54,915
  • 8
  • 91
  • 126
Krunal
  • 11
  • 5

1 Answers1

4

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

Traveling Tech Guy
  • 27,194
  • 23
  • 111
  • 159