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.
Step 2:
Drag “Input Dialogue” activity into the design panel and create a variable to save the “month” provided by the user.
Step 3:
Drag “Message Box” activity into the design panel to display the days count.
Step 4:
Finally!!!
Click here to download the Source Code…
Hope it has helped you…