Convert Datatable column(string) to Date

Hi,
I have scraped a particular table. The datatable consist of column(“Created Date”) which is something like “9/21/2020 11:55 AM” in this format.

I need to sort the datable in ascending order (created date) , for that I need to convert the "Created Date " column to Date format.

1 Like

@prateekjain1992

Check as below
https://forum.uipath.com/t/convert-date-time-format-tutorial/242670/2

Follow Link

Thanks

Without using loop, i want the column datatype and rows for that column change to date

You can not change the type in a DataTable when it contains data.

@moenk then how to sort on ascending date?

This will be a string sort though, but might work in this case:

No,this is not working…It is taking as string,need to convert to date

@prateekjain1992
find starter help here:
DT_SortDate.xaml (7.0 KB)

for finding the correct format just check the content of the datatable while debugging (Excel visual value is not mandatory the same within the datatable after a read range)

:ambulance: :sos: [FirstAid] Datatable: Debug & Analysis invalid DateTime Strings / String to DateTime Parsing Issues - News / Tutorials - UiPath Community Forum

Demo on this format:

1 Like

@prateekjain1992
grafik

1 Like

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