Ramco Ramco

Ramco Ramco

  • 442
  • 3.4k
  • 517k

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)