Parsing dates

I am copying dates from spreadsheet 1 into spreadsheet 2. When I parse the dates I am using:

DateTime.ParseExact(row(“Remittance Sent”).ToString,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

It copies the dates over, however when it parses the dates it is converting them incorrectly,
i.e in the Spreadsheet 1 the date is 01/02/2020 however when parsing it is writing out the dates in Spreadsheet 2 as 02/01/2020 (using the American format, not what I want)

I have tried many different things and am having no luck.

Could you please explain more clearly?
You have “01/02/2020” string as input
then you convert it to DateTime with “MM/dd/yyyy” → it will become the date value of 02-Jan-2020, right?
then you convert this datetime value to string with format “dd/MM/yyyy” → 02-Jan-2020 date will be 02/01/2020 - same with your received output in Spreadsheet2
What’s wrong here?


Can you try the following expression?

"'"+DateTime.ParseExact(row(“Remittance Sent”).ToString,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)