In column I = Date1, I want to change the cell from the date format "MM/dd/yyyy HH:mm:ss" to the format "dd-MM-yyyy HH:mm:ss"
In column J = Date2 I want to change the cell from the date format "MM/dd/yyyy HH:mm:ss" to the format "dd-MM-yyyy"
I’d like to make changes without using a loop through the data table. I think the use of LINQ will be appropriate.
Can someone proficient in LINQ help me?
Hi @prasath17,
thanks for quick response.
How to handle error?
RemoteException wrapping System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> RemoteException wrapping System.ArgumentException: String was not recognized as a valid DateTime.Couldn't store <15-07-2020 14:12:12> in Date1 Column. Expected type is DateTime. ---> RemoteException wrapping System.FormatException: String was not recognized as a valid DateTime.
The result comes directly from the SQL query and I’m working on System.DataTable (I don’t save it to a file). Probably the UiPath set the date format to Columns in DataTable?
This is what the data inside System.DataTable looks like:
@Adrian_Star
It can happen that excel will reformat the values, regardless on how it was set within the datatable. But have a look on following activity and change the cell format after write range: