Ramco Ramco

Ramco Ramco

  • 440
  • 3.4k
  • 527.5k

String was not reconized as a a valid DateTime format

Apr 22 2023 1:38 AM

Hi

  On below code i am getting above error. Value in sessiondate is 27/12/2021 00:00:00

                                        DateTime sessionDate = DateTime.ParseExact(colum1.SessionDate.ToString(), "dd-MM-yyyy", CultureInfo.InvariantCulture);

Thanks


Answers (5)