Date comparision


i want to check weather todays date is 25 or not and if it is not 25 i want to add 2 months to the current date how can this be done

Hi @sanjay_gowda

Can you try this

currentDate As DateTime = DateTime.Now
currentDate = If(currentDate.Day = 25, currentDate, currentDate.AddMonths(2))



Assign: currentDate = DateTime.Now
If (currentDate.Day = 25)
(Do something if it’s the 25th)
Assign: updatedDate = currentDate.AddMonths(2)

1 Like

Hi @sanjay_gowda

- Assign -> Output = If(DateTime.Now.toString("dd").equals("25"),DateTime.Now.ToString("MM/dd/yyyy"),DateTime.Now.addMonths(2).toString("MM/dd/yyyy"))

The above expression will check the today date is 25 or not. If it is 25 then it will take todays date only, if doesn’t it will add two months for the today’s date.

Check the below image for better understanding,

Hope it helps!!

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