How to compare a date with format dd/MM/yyyy against today?


The date has the following format: dd/MM/yyyy.
When I use:


It does not work



try giving today.toshortstring @EngAnalyst

1 Like

“toshortstring is not a member of date”

Sorry , it is ToShortDateString

“no accessible datediff can be called with these arguments”


Convert both the dates to date type using CDate


doesnt work

This is working for me…

Dim datestr1 As Date = CDate(“07/07/2019”)
Dim datestr2 As Date = CDate(Today.ToShortDateString)
MessageBox.Show(DateDiff(DateInterval.Day, datestr1, datestr2).ToString)

Take this as reference and create the workflow

The problem is that in my example the date is in the format dd/MM/yyyy instead of MM/dd/yyyy and i think UiPath does not recognize it


Try converting your date then :slight_smile:

I tried but it doesnt work


In my case the date obtained is 19/02/2018. When i manually set 02/19/2018 it works

Edit: i also tried “MM/dd/yyyy” and it does not work.

@EngAnalyst first convert the date which is in string to date time format like datetime.parseexact(datestring,“dd/MM/yyyy”,system.globalization.culturalinfo.invariantculture) this will give you the output of string into to compare this store the above expression in a variable say outdate by using if condition give like try this once let me know if anything goes wrong.