Ramco Ramco

Ramco Ramco

  • 471
  • 2.6k
  • 376.4k

String was not recognized as a Valid DateTime

May 9 2022 5:16 PM

Hi

In txtPaymentDate0.Text it is showing "07/05/2022 00:00:00". On below line it is giving above error

DateTime PaymentDate2 = DateTime.ParseExact(txtPaymentDate0.Text, "dd-MM-yyyy", System.Globalization.CultureInfo.InvariantCulture);

Thanks


Answers (2)