Appending values changes date format

excel
activities

#1

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.


#2

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


#3

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


#4

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


How to handle date format while reading the Excel file as it keeps on changing?
#5

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:


#6

Thanks for the reply…

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

Further I need to compare with today’s date