Filtered Excel DateTime Format - Help

Hi everyone,

Firstly I would like to thank all of you. Because before creating this post I found many solutions for my problems.

The problem is:

I cannot change the default Datetime format in UiPath datatable.

To be more specific, there is an excel file that I filtered with “Filter DataTable”
Date column output is like “05/16/2019 00:00:00” but I need it as “16/06/2019”
I need all the table range so I am not able to use assign and change the format.

I would appreciate your help on this

Hi
welcome to UiPath community

Thank you for your kind words, we are always glad to

and to convert the date format from “05/16/2019 00:00:00” to “16/06/2019”
use this expression inside the FOR EACH ROW loop where the datatable variable is passed as input

inside the loop with assign activity
row(“yourcolumnname”) = Datetime.ParseExact(row(“yourcolumnname”).ToString.SubString(0,10),“MM/dd/yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

Cheers @tgursu

1 Like

You can try below activity that I found on GO!
https://go.uipath.com/component/datatable-change-column-datatype

Or you can use Change format activity which changes the format in the excel directly.
https://go.uipath.com/component/excel-extension-activities

1 Like

Since you are getting in this format - “05/16/2019 00:00:00” so split it first using below code,
System.Text.RegularExpressions.Regex.Split(Input_string," ").ToString.
Then use below code to change it to specified format,
CDate(in_OrderDate.ToString).ToString(row(“OutDateFormat”).ToString)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.