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

1 Like

Hi,

In the read range activity try checking this option ,

1 Like

thank you

1 Like

if i want in this format but in string not datetimevariable

1 Like

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

1 Like

Hi @Mohamed_Hassan1 ,

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

Thanks.

1 Like

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