Convert dynamic values to date

Learning platform

UI Path

Description

Hi I am new to UI path

I have a doubt. I am getting values(dates) from excel in MM/dd/yyyy as string. I want it to be stored as date format. Because I need to compare two date. Date which I read from excel and current date.

I tried this :
DateTime.ParseExact( One , “d-M-yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”) where one is the variable in string which values I am getting from excel ex: 7/2/2024.

Can someone please help we with this. I want it to store in date format so I can perform which date is recent operation.

Thankyou in advance.

Link

Date

2024-06-14

1 Like

Hi @588b97c268cd7dd244bd4707e

Have you tried this?

Regards,

@588b97c268cd7dd244bd4707e

Cdate(yourvaluefromexcel) this will be in dateformat…dont include .ToString…that will convert to string again

Cheers