I have the following data in my date field of my GridView
: 2016-01-24T00:00:00
Before updating that field, I want to store that value in "dd/MM/yyyy" format.
To do that I'm doing the following:
IFormatProvider culture = new System.Globalization.CultureInfo("en-US", true);
string formattedHolDate = DateTime.ParseExact(holDate, "dd/MM/yyyy", culture).ToString("MM/dd/yyyy");
However, when running the code, I have the following error:
String was not recognized as a valid DateTime.
What is the right way to handle it?