UiPath Date Formatting From Excel

I’m using an excel sheet that is populated from a user and sent to me, and in one cell is a contract end date. I’m collecting this cell’s data and storing it as a variable with a datatype of DateTime, the assign looks like this:

“s1 = Convert.ToDateTime(dtUserInput.Rows(0).Item(“Contract End Date”).ToString)”

The outcome of that Variable is [04/23/2023 00:00:00], how can I get it to JUST “dd/MM/yyyy”?

@jackcawthra - pls try below

DateTime.ParseExact(dtUserInput.Rows(0).Item(“Contract End Date”).ToString, “MM/dd/yyyy HH:mm:ss”, System.Globalization.CultureInfo.InvariantCulture).Tostring(“dd/MM/yyyy”)

Doesn’t work, no idea where I’ve gone wrong

Changed the datatypes back to strings now, assign now reads:

“variable = dtUserInput.Rows(0).Item(“Contract End Date”).ToString.Trim”

Which is turning my cell data to the string of the date “04/23/2020” when it’s 23/04/2020 in excel?