How To Get The Day Count Of The Month In UiPath

In a few business processes that we automate, some times we have to count the number of days in a given month.

Let’s see how to do it in UiPath…

Int date_Variable = Datetime.DaysInMonth(_year,_month)

Note:
1.Replace the “_year” with your required “Year”
2.Replace the “_month” with your required “Month”


Example

Implementation using UiPath :

Let us implement a workflow which takes “Year” and “Month” as input and outputs the no.of days in that month i.e.

Step 1:
Drag “Input Dialogue” activity into the design panel and create a variable to save the “year” provided by the user.

UiPath Day Count Of The Month 1.PNG

Step 2:
Drag “Input Dialogue” activity into the design panel and create a variable to save the “month” provided by the user.

UiPath Day Count Of The Month 2.PNG

Step 3:
Drag “Message Box” activity into the design panel to display the days count.

UiPath Day Count Of The Month 3.PNG

Step 4:
Finally!!!

UiPath Day Count Of The Month 4.PNG

 

Click here to download the Source Code…

Hope it has helped you…

Advertisements

Author: Sharath Raju

Founder@www.ExcelCult.com

Leave a Reply