Change date format variable

Hello,

I have a datatable where the last column has the type datetime.
The format of that date time column is MM/dd/yyyy hh:mm and I want the format dd/MM/yyyy.
What can I do to obtain the format that I want ?

Thanks

Hello @Maria_Ines_Almeida

Please refer to the below doc.

dateST is the variable with the date value.

DateTime.ParseExact(dateST.ToString(),“MM/dd/yyyy hh:mm”,Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

1 Like

I tried the way you said but it returns an error image
image

Can you please check the value in the CurrentRow.Item(6).ToString()

yes

image

DateTime.ParseExact( CurrentRow.Item(6).ToString(),“MM/dd/yyyy hh:mm:ss”,Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

Try this.

Also you can check the Format value activity.


when i use it in a log message it works but when I assign to the item in the row it returns an exception
image
image
image

in the LHS, please assign a string variable instead of CurrenRow expression.