I am comparing two dates but its not working. Please suggest how can i do that

I am comparing two dates but its not working. Please suggest how can i do that. Today date is lesser than Due date but still system going in then condition in place of else.

You don’t need to have your own variable TodayDate. Just use the built-in Today expression.

DateTime.ParseExact(DueDate,“dd/MM/yyyy”,System…Culture) > Today

We just have to write Today only or there is any expression for today date.

“Today” is the expression for today’s date.

it showing an error.

@Puneet_Singh
have a look here:
grafik

Kindly note: Your screenshot shows:
grafik
vs.
your parsing is using a dd/MM/yyyy format.

So dpending on the real occuring format we do choose on of the datetime conversion options:
CDate, DateTime.Parse / ParseExact, Convert.ToDateTime

Change the format. still having issues :frowning:

Stuck here since frriday

Any reasons why this was not tried?

grafik

As mentioned

  • by Paul you can use Today
  • by the screenshot a MM/dd/yyyy format we can parse with CDate

But we see a big difference to the suggestions given to you
grafik

In case of exploration we suggest to do direct RnDs by small steps within the immediate panel
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

Again you use TODAY not TODAYDATE

Today is a standard expression. It is not a variable. You don’t create a variable named Today. It always exists.

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