Comparing_Dates

Hello all, is there any way in which I can compare today’s date(int the form of MM/dd/YYYY) and date_2 (in the form of MM/dd/YYYY). I have to make sure that date_2 is always greater than today’s date, if not then send a message.

Regards,
Hardik Durgam.

Hey @Hardik_Durgam ,

Have a look at this thread How to Compare two date

Thanks,
Sanjit

1 Like

HI @Hardik_Durgam

Checkout this condition

CDate(Now.Tostring("MM/dd/yyyy"))<Cdate(DateTime.ParseExact("03/03/2023",{"dd.MM.yyyy","MM/dd/yyyy hh:mm:ss","MM/dd/yyyy","dd.MM.yyyy hh:mm:ss"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("MM/dd/yyyy"))

By this the time will be always 00:00:00

and also comparing can be done with any kind of date not only specific format

Now<DateTime.ParseExact("03/03/2023",{"dd.MM.yyyy","MM/dd/yyyy hh:mm:ss","MM/dd/yyyy","dd.MM.yyyy hh:mm:ss"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None)

Regards
Sudharsan

1 Like

hi

take 2 date time variables one is today date and second is date2

today date =datetime.now

pass date 2 in this syntax
output_date=DateTime.ParseExact(input_date,formatconversion,System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat)

now use if condition to compare dates like today date<date 2 send email

Thanks @Sudharsan_Ka , it will be helpful if you could also share the workflow.

Regards,
Hardik Durgam.

@Hardik_Durgam

Checkout this
Sequence2.xaml (6.8 KB)

In here date_2 in the expression is the one where you need to give your second date variable and it should be in String

Regards
Sudharsan

2 Likes

@Sudharsan_Ka thanks for your help :slight_smile:

Regards,
Hardik Durgam.

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