Extract Date from excel file

I am trying to extract a date from excel data but it returns time with zeros like this 7/16/2021 00:00:00 how to remove zero

Hi @Mohamed_Hassan1 ,

If you are holding this value in DateTIme variable then just use datetimevariable.ToString(“MM-dd-yyyy”)

HI @Mohamed_Hassan1

Welcome to uipath community

once after reading datatable pass that dt to FOR EACH ROW activity as input and inside the loop use a assign activity like this

row(“column name of date”) = row(“Column name of date”).ToString.SubString(0,10).ToString.Trim

or
if we want in specific format we can mention that format in ToString(format we want)

row(“Column name of date”) = Convert.ToDatetime(CurrentRow(“Column name of date”)).ToString(“yyyy-MM-dd”)

for more details on diffferent date format

Hope this would help you

Cheers

Hi,

In the read range activity try checking this option ,

thank you

if i want in this format but in string not datetimevariable

Try this CDate(yourvariable).ToString(“MM-dd-yyyy”)

Hi @Mohamed_Hassan1 ,

Please mark it as a solution if it worked for you.

Thanks.

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