Unable to change Date format in Uipath

datatable
excel
activities

#1

Hello everyone,
I have been trying to merge two excel sheets with different date formats in them but I am getting the number of days instead of the date in the short date format. One format is “08-Feb-02” while the other is “01-01-1999” and I want it in “01-01-1999” format. Can anyone please help.


Change dateformat in row of datatable
#2

hi @jamnanin,

use this code to change date format (08-Feb-02 to 08-02-02)
DateTime.ParseExact(“08-Feb-02”, “dd-MMM-yy”, CultureInfo.InvariantCulture).ToString(“dd-MM-yy”)

Regards,
Arivu


#3

hi arivazhagan,
but where do i change it in the sequence


#4

Hi @jamnanin,

you are assign something to Values what is that???

Regards,
Arivu


#5

I am selecting the columns that I need by assigning “testRow.Select.CopyToDataTable().DefaultView.ToTable(False, “ID”, “Name”,“Insurance Amount”,“Dob”)” to values


#6

Hi @jamnanin,

Can you give more detail to better understand. Give some sample data with your xaml file

Regards,
Arivu


#7

this is the 1st file and
this is the 2nd file
and this is what i want as my final output

If you could send me a sample xaml on how to do this would be of great help. Thank you


#8

hi @arivu96,

is there a way to do this? I just want to know in which activity do i use the code? should i use an assign activity? if yes then what should i assign it to?


#9

Hi @jamnanin

yes, its possible. refer the xaml files.
MainDateFormatchange.xaml (13.1 KB)
input 1.xlsx (7.5 KB)
input 2.xlsx (7.5 KB)
Result.xlsx (8.7 KB)

Regards,
Arivu


#10

thanks a lot arivu for taking your time to help me out.