Appending values changes date format

whenever I tried to append the excel. the date format changes…

before appending -date format - 26-12-2017 14:41

after appending -date format -26/12/2017 14 :41 along with addition of spaces.

can anyone has idea how to solve the error.

Hi @Pavannaik,

Thats one such thing which happens to me as well when I work on excel as well.

In such cases , when there are leading or trailing extra spaces, then please use the Trim Function.

example : lets say I have a string named - Country_Name

So use Country_Name.ToString.Trim

Optionally , TrimStart / TrimEnd - as per your need.

UiPath also has TrimStart and Trim End for removing extra spaces from start of word and end of word respectively.

Please access this link for more info :slight_smile:
https://exceljet.net/excel-functions/excel-trim-function

Hope that helps

Thanks for the reply
for spaces I am using trim function

But the date format is getting changed.

In the next step I need to compare date.
it’s showing not a valid date-time format

This happens even when I use read csv activity and writing in excel sheet

My friend :slight_smile: it can probably be because that is default format in which a date in entered in your excel file.

If you change the date format setting in your excel file to 26-12-2017 14:41 (dd-mm-yyyy hh:mm), it will append the date as it is.

Cheers mate :slight_smile:

Thanks for the reply…

But how to get the values as it is using activity.

Further I need to compare with today’s date

Hi @prassin6

Im trying this and its not working…

like in add data row I have value as array… {1,“John”,Now()}
Id,name,date is my input value …
when i do append as workbook

it still write date as


I did excel colum as date you mentioned but still not working.

i have tryed with now().tostring and its same date formate…
and i want date as 20-01-21 11:06:11

I can get my expected date formate if i use Excel scope and do write rang but then it will open excel each time add value which is doing process slow and take time if you write several time to excel file and file is located on server and not on local pc.