I have a datatable DT with column date in the form like 20200101 and I would like to convert it to 01-01-2020 for the column.
I used the below expression in Assign:
row(“Reception Date”)= Datetime.ParseExact(row(“Reception date”).ToString,“dd-MM-yyyy”,System.Globalization.CultureInfo.InvariantCulture)
I am getting below error:
String was not recognized as a valid DateTime.
Thanks Adrian this worked for me.
I just have one question can this work with directly datatable variable instead of using for each loop. As the data is very large for each takes lot of time.
Do you need to iterate the Date conversion over more cases in the table? If so, for each row is required, but you can, for example, filter the data table to separatre DT leaving only the date column (for increasing speed), and then merge the processed table with the result table.
@Adrian_Star…not sure about this LINQ… I used in one of my project which had 35K rows and LINq query ran less than 5 mins where as filter datatable taking 15 plus mins.